You are not logged in.

#1 2011-10-22 18:22:28

gspe
Member
Registered: 2011-10-15
Posts: 12

Installing Arch on BTRFS: my setup

Hi everybody,
recently i've reinstalled my Arch and i've chosen the btrfs filesystem because i like, and would use, the snapshot features.

After long reading about btrfs on various forums and blogs, i've chosen the following layout for my filesystem.

In the root of the filesystem i've created 2 subvolumes:

arch__root  mounted under /
arch__home  mounted under /home

This is the mount point in fstab

# ArchDSK01 on Seagate 500Gb
UUID=bfd6a8b7-4ad0-45d8-8bf1-50df62a40705  /                    btrfs     defaults,autodefrag,compress=lzo,noatime,subvol=arch__root      0      0
UUID=bfd6a8b7-4ad0-45d8-8bf1-50df62a40705  /home                btrfs     defaults,autodefrag,compress=lzo,noatime,subvol=arch__home      0      0
UUID=bfd6a8b7-4ad0-45d8-8bf1-50df62a40705  /var/lib/ArchDSK01   btrfs     defaults,autodefrag,compress=lzo,noatime,subvolid=0             0      0

This naming was inspirited by meego naming. I think that is a good thing call the subvolume where the os is installed with the name of the distribution.

Under arch__home subvolume i've created __snapshots subvolume and i store the /home snapshots in this subvolume. This because if you mount a subvolume mount automatically mount all child subvolumes. In this way the users can easily access to all /home snapshots.

[root@kabuky home]# fcrontab -l
20:08:55 listing root's fcrontab
*/15 * * * * btrfs s snapshot /home /home/__snapshots/hourly-`date +%Y-%m-%d_%H:%M`
[root@kabuky home]# btrfs subvolume list /
ID 256 top level 5 path arch__root
ID 257 top level 5 path arch__home
ID 258 top level 5 path arch__home/__snapshots
ID 271 top level 5 path arch__home/__snapshots/hourly-2011-10-14_08:40
ID 272 top level 5 path arch__home/__snapshots/hourly-2011-10-14_08:45
ID 273 top level 5 path arch__home/__snapshots/hourly-2011-10-14_08:50
ID 274 top level 5 path arch__home/__snapshots/hourly-2011-10-14_08:55

Regarding the arch__root snapshots, since the actual version of btrfs can't mount a child subvolume by name but only by id i thik that it's better if we create the snapshot at filesystem root level, something like

arch__root__snap-2011-10-14

In this way will be easy to pass the rootflags argument to grub

rootflags=subvol=arch__root

become
rootflags=subvol=arch__root__snap-2011-10-14

that it's easier to remember.

I'm curious to know what do you think guys.

gspe

Offline

Board footer

Powered by FluxBB