Skip to main content

Resized The RAID And the Data Is Safe

The <a href="https://donatoroque.blogspot.com/2016/07/resized-raid-array.html">last post,</a> I was talking about resizing a component of my existing RAID. I was worried about losing data.

Here's how I did it without data loss.

/dev/md0                   /dev/sdb1        2TB
                                  /dev/sdc1        1TB

I am increasing the size of the partition and it's an important distinction because the order of the steps would be different otherwise. Check the status of the RAID array with:

$cat /proc/mdstat

Put a fail flag on the partition and remove it.
$sudo mdadm /dev/md0 -fail /dev/sdb1 --remove /dev/sdb1

Then we have to use fdisk to handle the physical resizing of the device. fdisk is an interactive application in text mode. So-
$sudo fdisk /dev/sdb1
-h     for help
-p     for primary partition
-d     delete
-n     new partition
if unsure choose the default option.
-q     to quit without saving
-w    to write the changes, now think first before hitting enter here

I used fdisk to create a new partition utilizing the entire 2TB device. I made an additional step here to check the filesystem after I created a new partition. Use fsck to verify the integrity of the ext3/ext4 filesystem. You should make sure to unmount the partition before checking with e2fsck. It will offer to fix errors you have to press consent or y for the process to continue, otherwise, use the -p switch to allow e2fsck to automatically repair the filesystem without human or administrator intervention.

$sudo e2fsck /dev/sdb1

Re-add the partition to the RAID array.
$sudo mdadm -a /dev/md0 /dev/sdb1

I had to wait 2 hours for the RAID to synchronize and then proceed to the next partition or the next step. Check the status of the synchronization with:

$cat /proc/mdstat

Do this steps one partition at a time.

Increase the size of the array with:

$sudo mdadm --grow /dev/md0 -z max  
or
$sudo mdadm --grow /dev/md0 -z [size]

Increase the size of the ext3/ext4 filesystem with:

$sudo resize2fs /dev/md0 [size]

If the size is not specified, the default is the size of the partition.


--
Donato Roque@ubuntu-16-04
mobile:63-9185721710
I'm on twitter, facebook and this is my blog.
Consider using my PGP keys for privacy.
Post a Comment

Popular posts from this blog

America Must Evolve Fast Or Die

This was a music festival concert venue in Las Vegas, Nevada. A shooter in the 32nd floor of a nearby hotel across the general area opened fire then shot himself. He killed 59 people in what reports call the biggest mass shooting in modern American history to date.
America must learn from the lessons of previous mass shootings otherwise this tragedy will happen again. Reasonable animals evolve when their lives and the life of the pack or group are threatened. They change how they face the problem and not just move on. They don't dismiss reality. They recognize the problem and listen to reason. For those who say nothing can be done, you're wrong. There is something America can do. It is not premature to talk about gun control. This is the time to talk about it.

GnuCash In Arch Linux

I updated a number of packages today and Gnucash won't start. I immediately went to the Archlinux website to see what's happening. I can't seem to find the package in the community repo. There's a thread in AUR on how to compile Gnucash by hand no AUR helpers.

But I tried to compile goffice and webkit2, needed packages for Gnucash-git. No. It doesn't work for me.

Funny but I'm now using my Android Tablet with Gnucash app to record transactions. This is working. We need to have the stable GnuCash back. This is a stop gap on my part. Transactions don't stop when computers stop. Please don't make me go back to paper.

Star Wars: The Last Jedi Poster

The Last Jedi is coming this December 2017. I can't wait. My guess is we can watch it later in the Christmas season or even later than the New Year 2018. The Filipino Film Festival season usually starts the 15th December up to January 7th. Only Filipino films are shown in theaters. Unless there's a special run, we would see it much later.