Share your knowledge at the LQ Wiki.
Go Back > Blogs > Lumak's Guide to Random Things
User Name


OK I don't really have a good title yet but I figure I can post works in progress and other tips I've come across or other interesting things.
Rate this Entry

More playing with BtrFS on Slackware

Posted 05-03-2011 at 08:58 AM by lumak
Updated 05-12-2011 at 04:19 AM by lumak

Ok well I'm done playing with all that for now.

Some issues I have with BtrFS for now are:
- Quotas can not be implemented on subvolumes.
- EDIT: A segfault when trying to use an encrypted volume with either a seed or its rewritable counterpart..
- Slackware does not ship with btrfstune to toggle the seed flag anyway.
- Slackware isn't equipped to multiboot multiple roots from the same btrfs.

However, in general, everything that is supported worked without issues. Even running bad commands that should break the file system did nothing than caused some reboot issues and a delay in the next mount (e.g. thinking that quotas were implemented and trying to use the filesystem resize options on subvolumes then specifying a size much smaller than the data stored on the volume)

So right now I reverted to a 15G btrfs lvm partition with later plans to see if seeding will eventually work with my setup. I don't really like running without Quotas placed on var, but I've only ever had a problem with MythTV reporting way to much to the log file by default. I don't plan on messing with that for a while. Maybe I can play with user quotas in that case.

Anyway, to get around a multiboot in Slackware, it seems very possible to edit the mount line in the 'init' file in the initrd-tree and re run mkinitrd without clearing the tree. by appending "subvolid=<id of subvolume>"

Line 274 of init in initrd-tree
  # Switch to real root partition:
  echo 0x0100 > /proc/sys/kernel/real-root-dev
  mount -o ro,subvolid=257 -t $ROOTFS $ROOTDEV /mnt
The id can be found by running:
btrfs subvolume list /path/to/mounted/filesystem
If you don't want to multiboot from the same btrfs, then you can set the default subvolume to mount and you won't have to change anything:
btrfs subvolume set-default <subvolume id> /path/to/mounted/filesystem

However, none of that really matters if you don't tweak anything before/after the slackware install.
If you create the btrfs in the Slackware setup menus, then it will install Slackware to the default subvolume of the file system. This is not recommended as it makes snapshots appear in the normal filesystem. Since I didn't understand what I was doing when I first installed using btrfs, I had to modify and move files around after installing Slackware. At the moment, it seems the best thing to do is setup everything before running 'setup' to install Slackware.

That is...
- Create a partition
- run mkfs.btrfs on the partition
- create a subvolume for slackware
- set that subvolume to the default mount.
- create any other subvolumes you want (var, usr, etc.) However, this is only important, at the moment, if you want to create individual snapshots or mount a particular subvolume from another OS. Later it will be important for imposing quotas

Then after installing Slackware the normal way, you can:
- change the default subvolume mount (if dual booting and this isn't the primary)
- edit the fstab entry to include "subvolid=<id>"
- create an initrd, edit the init file, recreate the initrd

Not to mention, this all gets more complicated if you are using luks and lvm.

If you can avoid it, do not use btrfs on an lvm partition. It works, but it's needless and it may be the cause of my Segfault with attempting a seed partition... maybe I did something wrong. I don't know.

Overall the experience was interesting and the commands for managing btrfs are easy to use. The 'help' output from them explain enough to use the tools without knowing anything prior.
Posted in Uncategorized
Views 3505 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 09:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration