Ok, I got a nice cash bonus from my boss. So I immediately spent it on a second Samsung 840 Pro 256GB SSD (as we all would ). Since my current S840P has been my main boot drive and is nearing fullness, I thought a nice 2-disk RAID would be the ticket.
In the olden days, I might have been using mdadm and ext4. Then I would be tediously backing up my drive, making a new RAID partition, restoring same data, crossing fingers, etc.
But not now. Not with btrfs! Please keep in mind - all the stuff being done below is on my boot drive while running! No USB or gparted discs required!
Here's my drive currently:
It has a swap partition on it that I've never used, thus the less-than-full 256GB partition size. So I want to do two things: Add the new drive into the old one as a RAID device and get rid of the virgin swap partition. Rather than revert to the old school methods outlined above, I'm going whole-hog (no, not SnowHog that's something completely different! ) new school!
Plugging in the new drive and booting up, I did these simple commands:
sudo mount /dev/sdi2 /mnt/s840p
sudo btrfs device add /dev/sdj /mnt/s840p
Now my filesystem looks like:
Ok, Now on to using that new space. A quick blkid shows that the old partition and the new drive are sharing the same UUID and label:
Note the "in Use" designation! Next, I turned off swap and removed the swap line from fstab. Then, I wanted to move the data to the new drive so I could remove the swap partition for the old drive and use the entire device.
sudo btrfs device delete /dev/sdi2 /mnt/s840p
does the trick (this took quite awhile - several hours). Now I have single drive filesystem.
Now my filesystem looks like:
Time to remove the old, smaller filesystem to clean the old drive off.
sudo mkfs.btrfs -f /dev/sdi
The "force" option ( -f ) was needed because btrfs detected the DOS partition table that existed on the drive.
Here we go:
Now we add this one to the other:
sudo btrfs device add /dev/sdi /mnt/s840p
Now we see:
OK, time to make it a RAID0 device:
sudo btrfs balance start -dconvert=raid0 /mnt/s840p
In an hour or so, I will have a RAID0 boot drive.
In the olden days, I might have been using mdadm and ext4. Then I would be tediously backing up my drive, making a new RAID partition, restoring same data, crossing fingers, etc.
But not now. Not with btrfs! Please keep in mind - all the stuff being done below is on my boot drive while running! No USB or gparted discs required!
Here's my drive currently:
Code:
[COLOR=#222222][FONT=Verdana]Label:'ssd840pro' uuid: 8f0c1661-4e84-4512-b875-23bcfd5be1d8 Total devices 1 FS bytes used 176.37GB [/FONT][/COLOR][COLOR=#222222][FONT=Verdana]devid 1 size 222.47GB used 222.47GB path /dev/sdi2[/FONT][/COLOR]
Plugging in the new drive and booting up, I did these simple commands:
sudo mount /dev/sdi2 /mnt/s840p
sudo btrfs device add /dev/sdj /mnt/s840p
Now my filesystem looks like:
Code:
[FONT=Verdana]Label:'ssd840pro' uuid: 8f0c1661-4e84-4512-b875-23bcfd5be1d8[/FONT] [COLOR=#222222][FONT=Verdana]Total devices 2 FS bytes used 176.37GB[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]devid 1 size 222.47GB used 222.47GB path /dev/sdi2[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]devid 2 size 238.47GB used 0.00 path /dev/sdj[/FONT][/COLOR]
Code:
[FONT=Verdana]root@office:~#blkid -o list[/FONT][COLOR=#222222][FONT=Verdana] device fs_type label mount point UUID[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]------------------------------------------------------------------------------------------------------------[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sda btrfs data1 (in use) ff5136d4-33e1-418e-80ca-d616b37bc70f[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sdf btrfs data1 (in use) ff5136d4-33e1-418e-80ca-d616b37bc70f[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sdg btrfs data1 (in use) ff5136d4-33e1-418e-80ca-d616b37bc70f[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sdh btrfs red (in use) dce8ff64-d316-40df-9425-961963d8c42d[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sdj btrfs ssd840pro (in use) 8f0c1661-4e84-4512-b875-23bcfd5be1d8[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sdi1 swap <swap> efa9e3d5-0537-4411-844c-0a6f48fd3848[/FONT][/COLOR] [COLOR=#222222][FONT=Verdana]/dev/sdi2 btrfs ssd840pro (in use) 8f0c1661-4e84-4512-b875-23bcfd5be1d8[/FONT][/COLOR]
sudo btrfs device delete /dev/sdi2 /mnt/s840p
does the trick (this took quite awhile - several hours). Now I have single drive filesystem.
Now my filesystem looks like:
Code:
Label: 'ssd840pro' uuid: 8f0c1661-4e84-4512-b875-23bcfd5be1d8 Total devices 1 FS bytes used 177.80GB devid 2 size 238.47GB used 180.03GB path /dev/sdj
Time to remove the old, smaller filesystem to clean the old drive off.
sudo mkfs.btrfs -f /dev/sdi
The "force" option ( -f ) was needed because btrfs detected the DOS partition table that existed on the drive.
Here we go:
Code:
Label: none uuid: 18dfb82f-3ed7-4fc8-99e0-4aaf83aff031 Total devices 1 FS bytes used 28.00KB devid 1 size 238.47GB used 2.04GB path /dev/sdi
Now we add this one to the other:
sudo btrfs device add /dev/sdi /mnt/s840p
Now we see:
Code:
Label: 'ssd840pro' uuid: 8f0c1661-4e84-4512-b875-23bcfd5be1d8 Total devices 2 FS bytes used 177.80GB devid 2 size 238.47GB used 180.03GB path /dev/sdj devid 3 size 238.47GB used 0.00 path /dev/sdi
sudo btrfs balance start -dconvert=raid0 /mnt/s840p
In an hour or so, I will have a RAID0 boot drive.
Comment