Author Topic: How to install Manjaro on btrfs subvolumes with CLI installer  (Read 10360 times)

0 Members and 1 Guest are viewing this topic.

Offline Nergal

  • Neuling
  • *
  • Posts: 44
  • Branch: Stable
  • Desktop: KDE Plasma 5
  • GPU Card: Intel / nVidia GTX 970M
  • GPU driver: non-free
  • Kernel: 4.4.3-1
  • Skill: Novice
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #15 on: 28. February 2016, 13:09:15 »
I just use linux for work so I am certainly not an expert....

Below is my fstab of my work desktop.
The mount points /boot and /boot/efi are on a separate SSD because the current version of GRUB does not boot on NVME.
Both are 512MB partitions.

The CLI version did not recognize NVME so I used THUS to install Manjaro and I was forced to do partitions rather than subvolumes for NVME  >:(.
The mount points /, /home and /home/akkyro/Dropbox are on the NVME. They are three separate partitions and dropbox is in a subvolume.

I think you are right about the pass value. On my laptop the root, home and dropbox are subvolmes and by default they were set to 0 2 and Manjaro booted just fine.

According to Arch Wiki discard should not be used with NVME.
https://wiki.archlinux.org/index.php?title=Solid_State_Drives/NVMe&redirect=no

I have made the following changes to /etc/mkinitcpio.conf:

btrfs before udev and removed fsck.


Code: [Select]

# <file system>                           <mount point>  <type>  <options>  <dump>  <pass>
PARTUUID=17d6fe0b-7b58-4a75-8b09-03eb58129148 /boot          ext4    defaults,noatime,discard 0       2
PARTUUID=2de3fee4-ee68-435f-8c8e-11e5ce5fb499 /boot/efi      vfat    defaults,noatime 0       2
PARTUUID=fa93645c-5f0a-4a1d-b7e7-65790efd394e /home          btrfs   defaults,noatime,ssd,compress=lzo,space_cache 0       0
PARTUUID=495e03be-8c76-408c-97da-bbba7d2aff30 /              btrfs   defaults,noatime,ssd,compress=lzo,space_cache 0       0
PARTUUID=58edae8f-ccd1-45cb-99ca-dbead9460ece /home/akkyro/Dropbox          btrfs   defaults,noatime,ssd,compress=lzo,space_cache,subvol=sub_dropbox 0    0

I have 4 hard disks in btrfs raid but they are currently not included in fstab. I am still trying to figure out what is the best way to add btrfs raid with subvolumes in fstab....
« Last Edit: 28. February 2016, 18:14:22 by Nergal »
___________________________________
MSI GS60 Ghost Pro 3K- i7-4710HQ - 16GB

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #16 on: 28. February 2016, 16:38:34 »
BTW, it is still possible to do a snapshot of the partition.
Code: [Select]
sudo mount -o compress-force=lzo,ssd,space_cache,noatime -t btrfs /dev/sda1 /mnt
sudo btrfs subvolume snapshot /mnt/ /mnt/snapshot280216
How to revert it, hmm, need to think about it...
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #17 on: 28. February 2016, 18:34:51 »
eugen-b, thanks for answering all those questions. After hours of reading and installing a lot of them cleared up that's why I edited my comment and removed them to not asked unnecessarily.

My boot is not UEFI, it is normal boot. I did not create a GPT but did mkfs.btrfs /dev/sda on the entire disk, which grub is supposed to be able to boot from, I followed these steps: http://wongdev.com/blog/pure-btrfs-installation/

Maybe that is the issue and I should create a partition table first, and maybe a vfat boot partition?

I tried the cli installer for encryption, it is able to detect and decrypt my luks device but when I ask it to set mountpoint to /dev/mapper/somename and it wants to format it as btrfs it just spits out an error. Also when teling it to setup luks it simply says error happened. I'm using the i3 spin, I'm happy to provide more logs if you can tell me which ones to post.

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #18 on: 28. February 2016, 18:54:25 »
Well, maybe other users who read it will have the same questions, so I left it there.
The CLI installer is generally a bit strange (no more up to date?) when it comes to partitioning.
If you know that your PC will work the way you set it up - as normal BIOS boot - then you should try with partitions, as you already wrote. I don't think you will lose much performance. (Are you using an SSD or an HDD?) It should be possible to apply encryption on your btrfs partition after the installation. I don't know whether you need a separate /boot partition for disk encryption.
Another way would be to try a graphical installer, encrypted single btrfs partition, see if it works and create the subvolumes afterwards. I used to create @ and @home subvolumes manually on antiX following this guide https://www.howtoforge.com/how-to-convert-an-ext3-ext4-root-file-system-to-btrfs-on-ubuntu-12.10-p2 (Didn't need the conversioin of ext4 to btrfs, but only the rest of the guide.)
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #19 on: 28. February 2016, 19:18:48 »
Thanks a lot, I'm trying with one /dev/sda1 instead of straight /dev/sda now, is straight /dev/sda for UEFI boot with GPT?

When I tried encryption by hand I couldn't get grub to unlock the drive during bootup, the arch wiki page on it is very confusing, I think I added the lines recommended by them to the wrong files. Doing a gui installer with encrypted btrfs and then looking at the config files is probably the way to go..

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #20 on: 28. February 2016, 19:41:01 »
Thanks a lot, I'm trying with one /dev/sda1 instead of straight /dev/sda now, is straight /dev/sda for UEFI boot with GPT?
It's for BIOS
When I tried encryption by hand I couldn't get grub to unlock the drive during bootup, the arch wiki page on it is very confusing, I think I added the lines recommended by them to the wrong files.
You probably forgot to add a line to the Grub code.
Doing a gui installer with encrypted btrfs and then looking at the config files is probably the way to go..
If it is supported for btrfs. If not installing on encrypted ext4 and later converting to btrfs could work.
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline Nergal

  • Neuling
  • *
  • Posts: 44
  • Branch: Stable
  • Desktop: KDE Plasma 5
  • GPU Card: Intel / nVidia GTX 970M
  • GPU driver: non-free
  • Kernel: 4.4.3-1
  • Skill: Novice
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #21 on: 28. February 2016, 19:44:06 »
For UEFI, you need a separate /boot/efi partition formated in vfat but there is no need for a separate /boot.
My laptop is setup like that where /boot/efi is located on a separate SSD and everything else is on a single SSD. BTRFS spans the whole drive and / and /home are just subvolumes, no partitions.

___________________________________
MSI GS60 Ghost Pro 3K- i7-4710HQ - 16GB

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #22 on: 01. March 2016, 00:33:35 »
Thank you all for your help, I installed one btrfs partition on /dev/sda1 instead of /dev/sda which allowed me to use parted to set boot option to that partition and then grub worked fine, not sure how to set boot when you use mkfs.btrfs on /dev/sda directly since parted won't even acknowledge the existence of a partition.

Feels so good to have the computer working again :) Btrfs is awesome just for the feature that you don't have to define space for partitions beforehand, that solves my issue of always running out of space on /.

A few btrfs tutorials I found like mounting the default volume of btrfs somewhere to make snapshots easier and to do readonly snapshots, what's your thought on that? I'd love to make a snapshot of my current working system and add it as a grub entry so I can directly boot into it if something breaks, or is that a bad idea ?

Can I do snapshots of / in a running system or do I have to do it from a live stick?

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #23 on: 01. March 2016, 00:48:59 »
I'm happy to know that it worked for you!
A few btrfs tutorials I found like mounting the default volume of btrfs somewhere to make snapshots easier and to do readonly snapshots, what's your thought on that?
I read about that but I have to admit that didn't understand it. It works ok the way I described. There can be optimizations which would matter in professional/server environment, but probably not needed on a smaller scale.
I'd love to make a snapshot of my current working system and add it as a grub entry so I can directly boot into it if something breaks, or is that a bad idea ?
This can be done probably. You do nothing else when you rename a snapshot to @, then Grub boots the "copy" not the original subvolume. But this can get you in administrational trouble and what is the use case supposed to be?
Can I do snapshots of / in a running system or do I have to do it from a live stick?
Probably yes, but you will get a "copy" of the files of a running system /tmp and other stuff. So this might be a bad idea. But you can mount the partition with the subvolume of a running system and make a snapshot of any subvolume on it including the "implicit" / subvolume.
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #24 on: 01. March 2016, 00:55:29 »
I But this can get you in administrational trouble and what is the use case supposed to be?
If my main install becomes unbootable I don't need a live usb stick to first revert to a working snapshot, I already have that snapshot in grub and can just boot into it ..

Probably yes, but you will get a "copy" of the files of a running system /tmp and other stuff. So this might be a bad idea. But you can mount the partition with the subvolume of a running system and make a snapshot of any subvolume on it including the "implicit" / subvolume.

I don't think I understand, so I'm running my main system and then mount @ into a different folder and then do the snapshot? Or I boot from a live usb stick? If /tmp is mounted as tmpfs will it still copy those files or how do you avoid it?

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #25 on: 01. March 2016, 01:07:50 »
If my main install becomes unbootable I don't need a live usb stick to first revert to a working snapshot, I already have that snapshot in grub and can just boot into it ..
Aha, that's a viable use case. I didn't think about that because I have several root subvolumes with different Manjaro installs. Therefore I don't need a live CD either.
So just create an entry in /etc/grub.d/40_custom as I desctibed before.
I don't think I understand, so I'm running my main system and then mount @ into a different folder and then do the snapshot? Or I boot from a live usb stick? If /tmp is mounted as tmpfs will it still copy those files or how do you avoid it?
By mounting you get rid of the whole temporary files and get the files the way they are supposed to be when booting.
As desribed before, first mount the partition then create a snapshot.
« Last Edit: 01. March 2016, 01:10:31 by eugen-b »
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #26 on: 01. March 2016, 01:09:36 »
Got it, did it! Thanks, if you had a btc address I'd tip you (not to late :-) )

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #27 on: 01. March 2016, 04:45:20 »
I am getting the "sparse file not allowed" error as reported here: https://forum.manjaro.org/index.php?topic=11791.0

Do you have the same issue or how did you get around it?

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #28 on: 01. March 2016, 10:35:47 »
I am getting the "sparse file not allowed" error as reported here: https://forum.manjaro.org/index.php?topic=11791.0

Do you have the same issue or how did you get around it?

Nothing to worry about, said gohlip.

"Sparce file not found" is only there booting to btrfs.
Is not there on boots to non-btrfs partitions.
Reinstalling won't help.

It is a 'specious' error message - meaning nothing to worry about, does nothing and not an error.
Yes, there are some ways to remove this, but I won't worry about this if I were you.
I wrote about this here some time back. cannot trace it now.

But reinstalling for other problems may be good, but this won't be one of them.

But what can be done is if your don't use swap to remove 'resume' from /etc/mkinitcpio.conf
HOOKS="base udev autodetect modconf block pcmcia resume filesystems keyboard keymap fsck usr shutdown plymouth"
and run
Code: [Select]
sudo mkinitcpio -p linux41
sudo mkinitcpio -p linux44
for kernels you have installed, here 4.1.x and 4.4.x.
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: How to install Manjaro on btrfs subvolumes with CLI installer
« Reply #29 on: 01. March 2016, 20:10:01 »
Thanks I will try that, the only reason why it bothers me is that it won't continue booting until I hit enter ..