[Discuss] BTRFS - Experiments

John Blomfield jabfield at shaw.ca
Sat Nov 8 18:31:32 PST 2014


Uhhg! What a disaster! Thank god for backups!

It all started when I attempted to up date my VirturalBox and run the 
usual kernel module setup. It complained about an inconsistency with the 
kernel version. I attempted to sort that out - somehow my kernel was not 
the same as the rest of the installed software - can't remember how that 
happened - probably too much meddling! Anyway I switch to a kernel 
compatible with everything else and found that my BTRFS data partition 
was not accessible even though it was properly mounted and I could see 
it from:

btrfs filesystem show

that the data was still there. In spite of a long long search I could 
find no help on this on how to get it back. I deleted the BTRFS 
partitions and re-configured them - re-loaded all my data from backup 
and I was good to go again. Then I thought I had better fix GRUB menu 
and get rid of the old kernels; this I did using Suse's Yast system 
manager and managed to lose all access to BTRFS partitions again! 
Couldn't figure out what happened unless it was to do with GRUB not 
being compatible with BTRFS. Totally mystified! To cut a very long story 
short during which the air was "blue" with curses, I have returned to 
good old ext4 and backups. Moral of the story "if it ain't broke don't 
fix it".

To cap it all my media server got messed up in the process so my wife 
could not watch her videos - that put me in the dog house.



John


On 11/05/2014 04:28 PM, John Blomfield wrote:
> OpenSuse 13.2 with a default BTRFS file system is now out; however, I 
> always wait a while before trying a new version so as to give the 
> developers time to sort out the usual rush of new bugs that did not 
> show up during beta testing. In the meantime I decided to try out 
> BTRFS on my existing OpenSuse 13.1 installation but without a complete 
> conversion. I have therefore just converted my data partition which 
> resides on my SSD and mirror it with BTRFS RAID1 on my HD. My SSD is 
> just 240 GB, my HD is 1 TB and my data partition is 150 GB. This 
> partition excludes photos and video since there is no room for those 
> on my SSD and I access those infrequently compared to the stuff on my 
> 150 GB data partition. Photos and Videos are in a partition on the 1 
> TB HD.
>
> My test then was on 150 GB SSD (sdb7) and 150 GB HD(sda9), mirrored 
> with RAID 1. There are lots of articles and documents to view on BTRFS 
> and quoting from one:
>
> "The RAID in Btrfs has some differences from the old-fashioned RAID 
> we're used to. In Btrfs RAID0 stripes your data across all available 
> devices with no redundancy. RAID1 mirrors your data in pairs, 
> round-robin across all available devices, so there are always two 
> copies of your metadata regardless of how many devices are in the 
> storage pool."
>
> So I could set up RAID 1 with mirrored meta data or with everything 
> mirrored. I chose the latter. Before starting of course I made a fresh 
> backup of my data (sdb7) and then tried:
>
> # btrfs-convert /dev/sdb7
>
> it seemed to work in that I could mount it and access it but when I 
> tried to add a second drive (sda9) and convert it to RAID 1 it failed. eg
>
> # mount /dev/sdb7 /mnt/btrfs-test/
> # btrfs device add -f /dev/sda9 /mnt/btrfs-test/
> # btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/btrfs-test/
> # "failed - error message", it didn't matter whether of not sda9 was 
> formatted ext4 or btrfs.
>
> Since I had a fresh backup of sdb7 I decided to reformat both sdb7 and 
> sda9 and build a RAID 1 btrfs pair from scratch, I had already tried 
> this out on a spare USB HD so I new it would work i.e.
>
> # mkfs.btrfs -f -d raid1 /dev/sdb7 /dev/sda9
> # btrfs filesystem label /dev/sdb7 DATA        (I could have used the 
> -L option in the above command to do this)
> # mount /dev/sdb7 /home/john/data
>
> To see what has been done:
> # btrfs filesystem show
>
> Finally it was necessary to update my /etc/fstab file which used to 
> contain the mounting instruction:
>
> /dev/sdb7    /home/john/data        ext4 defaults,user_xattr        0 0
>
> and change to:
>
> /dev/sdb7    /home/john/data        btrfs 
> device=/dev/sdb7,device=/dev/sda9,defaults    0 0
>
> after saving /etc/fstab and unmounting;
>
> # umount /dev/sdb7
>
> and then re-mount:
>
> # mount -a
>
> SUCCESS!
>
> One more thing to note is that gparted shows a warning error on sdb7 
> plus the normal mounted symbol (a key) and no used space info, 
> whereas, sda9 shows no mounted symbol and the correct used space info. 
> Also the normal commands df and du do not work correctly for BTRFS you 
> need to use:
>
> # btrfs filesystem df /home/john/data/
>
> I shall still of course be running my regular daily and weekly backups 
> since this is all automatic and unaffected by the change. Hopefully I 
> will learn over the course of the coming weeks whether or not there 
> are any problems with this setup and if I get any disk failures then 
> it will be easy to fix.
>
> I hope the above was helpful to anyone who might try something similar.
>
> John
>
>
>
>
>
>
>
>
>
> -- 
> John Blomfield
> Delivered by Thunderbird Email on Linux OpenSuse-KDE4
>
> Old John B's Linux Noteshttp://www.oldjohnbslinux.wordpress.com
>
>
>
>
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://lists.vlug.org/mailman/listinfo/discuss


-- 
John Blomfield
Delivered by Thunderbird Email on Linux OpenSuse-KDE4

Old John B's Linux Notes http://www.oldjohnbslinux.wordpress.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://vlug.org/pipermail/discuss_vlug.org/attachments/20141108/b711ad69/attachment.html>


More information about the Discuss mailing list