You are not logged in.

#1 2014-01-27 03:26:15

LinuxPatriot
Member
Registered: 2014-01-19
Posts: 52

How to use btrfs subvolumes in the instsllation??

hello im not sure if this was supposed to be here or in installation sorry if i put it in the wrong place

well here i go ok i tried to install arch and tried to use btrfs subvolumes and it did not work it said something like (im not sure if this is correct) "sbin/init/ does not exist" when i booted up sad

so i just did without but i really want that so how do i do this btw i looked at the wiki already hmm
so if anyone knows how it will be greatly appreiciated thank you for my time peace big_smile

Last edited by LinuxPatriot (2014-01-27 03:27:35)


"there is no meaning to life except to enjoy it"
Computer Specs: case Rosewill thor V2 , motherboard: MSI GD65 , cpu: Intel i5 4670k , gpu: MSI N760TF (GTX 760) , ram: Team Vulcan (2x4gb) , cooling: corsair h90 , storage: WD 1tb HDD Samsung 840 pro SSD, psu: Rosewill Hive 650w , extra: TP-Link  TL-WDN4800

Offline

#2 2014-01-27 03:30:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,611

Re: How to use btrfs subvolumes in the instsllation??

Depends on what you're doing exactly. If you're trying to install to a subvolume other than the root subvol, you need to either specify it on the kernel command line of your bootloader or set that subvolume as default.

Offline

#3 2014-01-27 03:59:26

LinuxPatriot
Member
Registered: 2014-01-19
Posts: 52

Re: How to use btrfs subvolumes in the instsllation??

thx for such fast relply i wanted the root and home on it could someone show me how to do that


"there is no meaning to life except to enjoy it"
Computer Specs: case Rosewill thor V2 , motherboard: MSI GD65 , cpu: Intel i5 4670k , gpu: MSI N760TF (GTX 760) , ram: Team Vulcan (2x4gb) , cooling: corsair h90 , storage: WD 1tb HDD Samsung 840 pro SSD, psu: Rosewill Hive 650w , extra: TP-Link  TL-WDN4800

Offline

#4 2014-01-27 04:10:28

benjamin
Member
Registered: 2013-10-15
Posts: 13

Re: How to use btrfs subvolumes in the instsllation??

The only thing you need to do is to make sure you mount the subvolumes before doing the "pacstrap" process.
This is from memory, but I usually do something like this:

mkfs.btrfs /dev/sdX
mount /dev/sdX /mnt
cd /mnt
btrfs subvolume create @
btrfs subvolume create @home
cd
umount /mnt
mount /dev/sdX /mnt -o subvol=@
mount /dev/sdX /mnt/home -o subvol=@home

I tend to use @ and @home for my / and /home subvolume names (as per Debian style), but they can be whatever you want. The main point is that you have to explicitly mount using the subvolumes before doing the pacstrap. Also, give your /etc/fstab a look after you do the genfstab, as it sometimes needs manual tweaking. Just ensure that it has the right subvolumes listed in it (which it usually picks up automatically).

Offline

#5 2014-01-27 04:17:32

LinuxPatriot
Member
Registered: 2014-01-19
Posts: 52

Re: How to use btrfs subvolumes in the instsllation??

thank u very much benjamin  but do i need to do any thing else like i heard u need to make the root subvoulume default ?


"there is no meaning to life except to enjoy it"
Computer Specs: case Rosewill thor V2 , motherboard: MSI GD65 , cpu: Intel i5 4670k , gpu: MSI N760TF (GTX 760) , ram: Team Vulcan (2x4gb) , cooling: corsair h90 , storage: WD 1tb HDD Samsung 840 pro SSD, psu: Rosewill Hive 650w , extra: TP-Link  TL-WDN4800

Offline

#6 2014-01-27 04:32:15

LinuxPatriot
Member
Registered: 2014-01-19
Posts: 52

Re: How to use btrfs subvolumes in the instsllation??

oh btw i would like to enable compression with lzo woud i just add the compress=lzo in fstab?
also since i have a 1tb hdd i wanted to make a subvolume on that partion same would i go about this the same way as shown above?

Last edited by LinuxPatriot (2014-01-27 04:39:22)


"there is no meaning to life except to enjoy it"
Computer Specs: case Rosewill thor V2 , motherboard: MSI GD65 , cpu: Intel i5 4670k , gpu: MSI N760TF (GTX 760) , ram: Team Vulcan (2x4gb) , cooling: corsair h90 , storage: WD 1tb HDD Samsung 840 pro SSD, psu: Rosewill Hive 650w , extra: TP-Link  TL-WDN4800

Offline

#7 2014-01-28 11:37:11

benjamin
Member
Registered: 2013-10-15
Posts: 13

Re: How to use btrfs subvolumes in the instsllation??

Yes, that should be all you have to do. You just mount your two drives independently, one directly to /mnt, and the other to /mnt/home as in my example above.

Just for your information, I'll post one of my fstabs below. I also like to use the autodefrag option, which I would recommend as it seems to work well in my ~1 year testing (but I think is supposed to have a slight performance hit).


# /dev/sdb LABEL=vertex
UUID=dc42a7ab-cf95-4509-a710-219e117678cd       /               btrfs           rw,relatime,space_cache,compress=lzo,autodefrag,subvol=@        0 0

# /dev/sdb LABEL=butter
UUID=cd8d45cd-fdde-4c96-992a-0015f70d4a59       /home           btrfs           rw,relatime,space_cache,compress=lzo,autodefrag,subvol=@home    0 0

Offline

#8 2014-01-28 15:46:47

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use btrfs subvolumes in the instsllation??

Keep in mind that simply adding the 'compress=lzo' mount option will not automagically compress all the things.  If you installed the system without compression on, those existing files will continue not be compressed until they are rewritten.  Of course, new files will be compressed.

Compression can be a great thing, but it is not necessarily appropriate for all cases.  If, for example, you use an SSD with a Sandforce controller (which replies on compression internally), then you are simply making the final write to the drive less compressable and slower for the drive.  So you would be trading compression work in the controller, for which it was specifically designed to handle, and trading it for cpu cycles.

Also, compression can slightly hinder the filesystem's ability to properly do Copy-on-Write operations.  Typically, a write will result in just the changed parts being written.  But in this case, it actually has to decompress an entire leaf/node, write the changes, then rewrite that leaf.

Offline

#9 2014-01-28 16:40:08

benjamin
Member
Registered: 2013-10-15
Posts: 13

Re: How to use btrfs subvolumes in the instsllation??

Excellent points, WonderWoofy. I use an OCZ Vertex 2 in my home desktop, and I find that btrfs compression seems to produce a smaller sized subvolume than without, though I don't really understand the Sandforce controller compression enough to know whether or not it's visable at the FS level. (Do you know if this is the case?).
My root subvolume does appear smaller by a handful of GBs with compression, so I've left the compress=* option on for about a year now. My thinking was that the possible performance impact wasn't as important as the disk usage, since it's only a60GB drive.

I haven't really thought about the compression impact on Copy-on-Write, which is an interesting point. I do use snapper, so it might be worth looking into. Do you know any further writeups about that that you could share?

Offline

#10 2014-01-28 16:48:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use btrfs subvolumes in the instsllation??

I don't know of any further write ups on the topic, but it was something I had been thinking about when I noticed conversation about it in the #btrfs freenode channel. 

As far as reported disk usage with filesystem compression vs. controller/Sandforce compression, I am fairly positive that the compression from the controller is transparent and thus wouldn't differentiate between actual data stored on disk vs file size.  So it is really quite hard to do a comparison here of what would be more advantageous in your case.  Considering that you have a 60G SSD, which can make things pretty tight, it might be a good thing to just leave compression on to gain any potential space savings that may (or may not) come with it. 

Just beware that the compression's effect on CoW is in essence increasing write amplification (as does autodefrag).  So with one of those old OCZ disks, just be extra sure that you have updated the firmware to avoid an untimely death of the drive.  Most newer SSDs should be fine with this mildly increased write amplification though...

Offline

#11 2014-01-28 17:28:50

jayflo
Member
Registered: 2013-09-06
Posts: 33

Re: How to use btrfs subvolumes in the instsllation??

Offline

Board footer

Powered by FluxBB