Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] btrfs (filesystem) Convert Wheezy or newer  (Read 7813 times)

sqlpython

  • Guest
[EN] btrfs (filesystem) Convert Wheezy or newer
« on: 2012/03/12, 01:15:43 »
This popped up on my Debian feed today
I thought some would find it of Interest.

What is btrfs ?
http://en.wikipedia.org/wiki/Btrfs

Ok... How do You convert it...
http://tinyurl.com/6vc9b85

Edit by holgerw: moved to experimental subforum

holgerw

  • Guest
btrfs (filesystem) Convert Wheezy or newer
« Reply #1 on: 2012/03/12, 06:16:29 »
Hello,

for all people, who like to make tests with btrfs:
This file system is experimental. btrfs hasn't a stable fsck mechanism yet.

So, if you want to test it, be careful with your files. But be free to post your experiences with it here.

Kind regards,
  Holger

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
btrfs (filesystem) Convert Wheezy or newer
« Reply #2 on: 2012/03/13, 13:50:16 »
When I built my new desktop computer (DEC 2010), I chose an Asus P6X58D-E system board which has a Marvell 9128 6G/s SATA controller (2 ports).  To take advantage of that, I bought a pair of WDC WD1002FAEX hard drives, and connected them to the Marvell ports.

Then I followed the wiki to install a btrfs filesystem on both drives, using defaults. This means my data are striped similar to RAID0, and the metadata are mirrored similar to RAID1. It has been my main data storage filesystem for these 15 months.  (My OS is on a SSD).  Here is the current status:

Code: [Select]
root@imerabox:/home/don# btrfs fi df /mnt/DATA
Data, RAID0: total=820.00GB, used=768.36GB
Data: total=8.00MB, used=0.00
System, RAID1: total=8.00MB, used=72.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=12.62GB, used=1.55GB
Metadata: total=8.00MB, used=0.00


Although it is true, technically, that btrfs is in "experimental" status, my experience indicates it is also true, as stated on their main wiki page, that "Btrfs is stable on a stable machine".

There is one caveat -- don't try to run a VM from a btrfs filesystem, because there is a performance problem and it runs too slow.
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline DeepDayze

  • User
  • Posts: 457
btrfs (filesystem) Convert Wheezy or newer
« Reply #3 on: 2012/03/13, 16:41:18 »
Quote from: "dibl"
There is one caveat -- don't try to run a VM from a btrfs filesystem, because there is a performance problem and it runs too slow.


Another very good reason to state that btrfs is "experimental"

Until btrfs is really solid and causes no performance issues even if a VM is run from it it still is deemed to be an experimental filesystem. As filesystems are very very complex, they are very hard to debug so it takes a lot of time and hard work to get a filesystem stable with no major regressions that cause data or performance losses.

This was said of ext4 even not that long ago, and now ext4 is quite solid and is in wide use.

Offline ralul

  • User
  • Posts: 1.814
btrfs (filesystem) Convert Wheezy or newer
« Reply #4 on: 2012/03/13, 19:00:12 »
There are still bugs regarding little free space on a btrfs partition. And this can happen quickly when using snapshots...

Regarding: big files, VM machines
Does someone know how a "COW" filesystem should handle these? If for example I edit a video file of size GigaByte and my video stream editor saves my editing, how is this handled for such a COW filesystem as btrfs is?

Do I have to wait some minutes until a fresh copy of the video file is created?
experiencing siduction runs better than my gentoo makes me know I know nothing

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
btrfs (filesystem) Convert Wheezy or newer
« Reply #5 on: 2012/03/13, 20:35:27 »
Quote from: "ralul"
If for example I edit a video file of size GigaByte and my video stream editor saves my editing, how is this handled for such a COW filesystem as btrfs is?


I have not edited videos, but I have used audacity to edit large .wav music files (1 side of a 33.3 rpm album).  Doing this many dozens of times, I saw no issue with the filesystem.

Here's a good piece to read before you try btrfs:

https://btrfs.wiki.kernel.org/articles/g/o/t/Gotchas.html
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline ralul

  • User
  • Posts: 1.814
btrfs (filesystem) Convert Wheezy or newer
« Reply #6 on: 2012/03/13, 21:43:44 »
@dibl,
if you have a decent modern machine using 4 GigaByte of RAM, you will have nearly 1-Gigabyte of cache in use. You can easily see this by copying some iso images onto a slow USB stick: The first image seems to get copied in a second, then the system slows down.

I wonder what if files are multiple times larger than your cache (probably wav files fit into your cache). There are only a few possibilities how this could be handled smoth with a COW filesystem:

- the kernel has a limit by which large files dont COW any more (if renewed files are larger than free space ...). Or
- btrfs tails down large files into pieces. If you edit a large file this means in reality you edit just a piece which got COWed.

I believe btrfs issues with VM machines are kind of these problems. I would not use btrfs for /home, but it is ok for  / - systemroot as you can reinstall :)

And there is a must-have feature of btrfs:
Unbreakable Debian sid using snapshots!

But size a btrfs system partition four times larger than you have done with ext4 !
experiencing siduction runs better than my gentoo makes me know I know nothing

Offline DeepDayze

  • User
  • Posts: 457
btrfs (filesystem) Convert Wheezy or newer
« Reply #7 on: 2012/03/14, 00:29:00 »
Snapshots are a nice thing to have and for example if a major d-u fails for example you can roll it back to a snapshot taken before the d-u, much like doing a system restore in Windows

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
btrfs (filesystem) Convert Wheezy or newer
« Reply #8 on: 2012/03/14, 00:41:00 »
A .wav file that is one side of a 33.3 rpm record is roughly 225M in size.

My system:

Code: [Select]
don@imerabox:~$ inxi -v2
System:    Host: imerabox Kernel: 3.2-9.towo.2-siduction-amd64 x86_64 (64 bit)
           Desktop: KDE 4.7.4 Distro: aptosid 2011-02 Ἡμέρα - kde-lite - (201107131633)
Machine:   Mobo: ASUSTeK model: P6X58D-E version: Rev 1.xx Bios: American Megatrends version: 0602 date: 03/24/2011
CPU:       Quad core Intel Core i7 CPU 950 (-HT-MCP-) clocked at 4217.006 MHz
Graphics:  Card: nVidia GF100 [GeForce GTX 480] X.Org: 1.11.4 driver: nvidia Resolution: 1920x1200@50.0hz
           GLX Renderer: GeForce GTX 480/PCIe/SSE2 GLX Version: 4.2.0 NVIDIA 295.20
Network:   Card: Marvell 88E8056 PCI-E Gigabit Ethernet Controller driver: sky2
Drives:    HDD Total Size: 2136.5GB (3.6% used) 1: OCZ
           2: OCZ 3: WDC_WD1002FAEX 4: KINGSTON_SS100S2 5: WDC_WD1002FAEX
Info:      Processes: 297 Uptime: 5 days Memory: 2131.3/5966.4MB Client: Shell inxi: 1.7.29


so 6GB of memory.

I mount the btrfs filesystem with compression:

Code: [Select]
UUID=c112ed57-0e33-4d4b-82c9-5c55932c529d     /mnt/DATA            btrfs        device=/dev/sdd,device=/dev/sde,compress

I know that copying large files onto a USB stick is slow, but it is slow from ext4 too.  I don't think that is relevant to btrfs performance.
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline ReinerS

  • User
  • Posts: 1.061
btrfs (filesystem) Convert Wheezy or newer
« Reply #9 on: 2012/03/14, 18:46:29 »
Hmm, following this discussion I decided tor experiment a little bit with btrsf and converted some data-/home-partitions from ext3/ext4 into btrsf.

Went fine so far, the only issue I currently have is that I wanted to mount those partitions via "LABEL=" in fstab.
That fails on one box but seems to work on another box :?
The fstab-entry which doesn't work is as follows:
Code: [Select]
LABEL=Server /srv btrfs  defaults,noatime,subvol=__active 0 0
where the working line on the other box is:
Code: [Select]
LABEL=USB320GB /media/USB320GB btrfs auto,users,rw,noatime 0 [0
A mount -a brings :
Code: [Select]
mount: Datei oder Verzeichnis nicht gefunden
LABEL=Server            /srv                 btrfs        defaults,compress,noatime,subvol=__active           0    0
(File or directory not found)

I helped myself by testing the necessary mount-command manually and inserting it then into rc.local
Code: [Select]
mount -t btrfs LABEL=Server /srv
Any idea on that behavior ?

Also I have currently on one box an logical volume formatted with ext4 which includes partitions on two disks. I would like to convert that to btrfs too.
Is it reasonable to just convert the ext4-File-System into btrfs and leave the underlying volume group untouched ?

As I understand btrfs itself has the same feature by adding several Partitions on different disk to one logical partition and doesn't need LVM. So what is the best way for that?
Leaving LVM alone and just converting the file-system or should I and create that btrsf-Volume from scratch and reload the backup (a whole lot of dvds)?

Has somebody some suggestions or hints on that :?

regards

Reiner

Edit:
I solved the fstab-issue for now with this entry:
Code: [Select]
LABEL=Server  /srv  btrfs  defaults,compress,noatime,subvol=__active  0  0
This seems to work as I had planned it
slackware => SuSE => kanotix => sidux => aptosid  => siduction

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.345
    • Land of the Buckeye
btrfs (filesystem) Convert Wheezy or newer
« Reply #10 on: 2012/03/14, 20:21:50 »
Quote from: "ReinerS"

Is it reasonable to just convert the ext4-File-System into btrfs and leave the underlying volume group untouched ?

As I understand btrfs itself has the same feature by adding several Partitions on different disk to one logical partition and doesn't need LVM. So what is the best way for that?
Leaving LVM alone and just converting the file-system or should I and create that btrsf-Volume from scratch and reload the backup (a whole lot of dvds)?

Has somebody some suggestions or hints on that :?


I would think your procedure should be:

1. Convert individual ext4 filesysems to btrfs

2. Mount one btrfs filesystem

3. Use the
Code: [Select]
btrfs device add /dev/sdxy command to add the other btrfs filesystem(s).

But, I am only speculating -- I have not done it myself.
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline ReinerS

  • User
  • Posts: 1.061
btrfs (filesystem) Convert Wheezy or newer
« Reply #11 on: 2012/03/14, 23:48:45 »
@dibl:
Yes, that would be exactly the prozedure when rebuilding such an volume from scratch.
For now I will probably convert the huge ext4-filsystem (1.8 TB) ,which is made out of two partitions on seperate disks, just into one btrs-file-system and will leave the underlying LVM-structure untouched.
Later on I will do exactly as you suggested and reload tha data from a backup. This looks like the "cleanest" path for this task to me.

I finally ended up with this line in fstab for mounting the btrs-file-system:
Code: [Select]
LABEL=Server  /srv  btrfs  defaults,compress,noatime  0  0

Regards

Reiner
slackware => SuSE => kanotix => sidux => aptosid  => siduction