You are not logged in.

#1 2014-09-22 19:21:56

das_j
Member
Registered: 2014-08-10
Posts: 4

Troubles with having usr in an LVM

I installed Arch Linux with some Partitions (home, opt, srv, usr, var) on a second HDD in a LVM.
When I start my computer, it sometimes works, but sometimes, I get an error:

mount: Special device /dev/mapper/data-usr does not exist.
ERROR: Root device mounted successfully, but /sbin/init does not exist!
Bailing out, you are on your own. Good luck.

pvinfo

  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               data
  PV Size               2.71 TiB / not usable 3.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              711556
  Free PE               171652
  Allocated PE          539904
  PV UUID               uCRhlz-dlU4-QMJk-vB2S-cL4y-Wbxe-Zzpv1H

vgdisplay

  --- Volume group ---
  VG Name               data
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               2.71 TiB
  PE Size               4.00 MiB
  Total PE              711556
  Alloc PE / Size       539904 / 2.06 TiB
  Free  PE / Size       171652 / 670.52 GiB
  VG UUID               bhFMEU-xmoD-QxiL-dJBx-Kv7p-BbmP-ZY1Ks6

vgscan

Reading all physical volumes.  This may take a while...
  Found volume group "data" using metadata type lvm2

ls -la /dev/mapper

crw------- 1 root root 10, 236 Sep 22 19:29 control
lrwxrwxrwx 1 root root       7 Sep 22 19:29 data-home -> ../dm-0
lrwxrwxrwx 1 root root       7 Sep 22 19:29 data-opt -> ../dm-1
lrwxrwxrwx 1 root root       7 Sep 22 19:29 data-srv -> ../dm-2
lrwxrwxrwx 1 root root       7 Sep 22 19:29 data-usr -> ../dm-3
lrwxrwxrwx 1 root root       7 Sep 22 19:29 data-var -> ../dm-4

From my /etc/mkinitcpio.conf

HOOKS="base udev autodetect modconf block lvm2 filesystems btrfs keyboard shutdown usr"

cat /etc/fstab

# UUID=ff06b16c-af60-4a9b-830d-a428c2773ad5 LABEL=arch
/dev/sda1               /               btrfs           rw,relatime,ssd,space_cache     0 0

# UUID=01a36bab-1fd4-4567-b057-dde52c843b64 LABEL=home
/dev/mapper/data-home   /home           btrfs           rw,relatime,space_cache 0 0

# UUID=8d81e3f4-5bae-40f9-a353-8b7d82a78e61 LABEL=opt
/dev/mapper/data-opt    /opt            btrfs           rw,relatime,space_cache 0 0

# UUID=aa747166-0ec7-4ced-9e7f-36a80507848c LABEL=srv
/dev/mapper/data-srv    /srv            btrfs           rw,relatime,space_cache 0 0

# UUID=38532832-599d-41ed-bf5e-d476bf9c2cb8 LABEL=usr
/dev/mapper/data-usr    /usr            btrfs           rw,relatime,space_cache 0 0

# UUID=3317f4ee-9b26-4b5c-97d2-300556f57fd5 LABEL=var
/dev/mapper/data-var    /var            btrfs           rw,relatime,space_cache 0 0

# UUID=4cff7ed4-cd39-4b6e-9cea-6a96e6c85011 LABEL=swap
/dev/sdb2               none            swap            defaults        0 0

uname -r

3.16.3-1-custom

cat /proc/cmdline

BOOT_IMAGE=/boot/vmlinuz-linux-custom root=UUID=ff06b16c-af60-4a9b-830d-a428c2773ad5 rw iommu=pt lvmwait=/dev/mapper/data-usr quiet

Everything (sda and sdb) is running on GPT. Using Grub 2 and a custom kernel.

Can anybody help me with that?

Best Regards
Janne

Last edited by das_j (2014-09-22 19:44:41)

Offline

#2 2014-09-23 20:02:55

das_j
Member
Registered: 2014-08-10
Posts: 4

Re: Troubles with having usr in an LVM

Update:

I removed `quiet` from the kernel command line and got this output:

:: running early hook [udev]
:: running early hook [lvm2]
:: running hook [udev]
:: Triggering uevents...
:: running hook [btrfs]
Scanning for Btrfs filesystems
:: mounting ´/dev/sda1´ on real root
:: running late hook [usr]
:: mounting ´dev/mapper/data-usr´ on /usr
mount: special device /dev/mapper/data-usr does not exist
:: running cleanup hook [shutdown]
:: running cleanup hook [lvm2]
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.

Hope it helps helping me :-)

Offline

#3 2014-09-24 05:00:25

MSC
Member
Registered: 2014-07-13
Posts: 33

Re: Troubles with having usr in an LVM

Maybe use UUIDs in your fstab, instead of /dev/mapper paths? I'd also recommend booting the standard kernel temporarily to find out if the issue is present there, or only in your custom version.

Offline

#4 2014-09-24 05:06:10

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

Re: Troubles with having usr in an LVM

I know this doesn't help you at all, but you should keep in mind that a separate /usr is not incredibly well supported.  Sure there is a hook for it in mkinitcpio, but it likely doesn't enjoy thorough testing.

If it were me, I would avoid such a setup, as it is likely to cause more pain than anything.  Sorry I don't have a better answer.  But I guess you could at least put 'break=premount' on the kernel command line, let it drop you into the initramfs shell and then see if those paths in /dev/ exist.

Offline

#5 2014-09-24 14:07:58

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Troubles with having usr in an LVM

It's possible that the /usr hook needs to wait on the device before fsck/mounting, but I've never heard of such a setup where this actually matters. Or, nobody uses the /usr hook.

I'm highly confused by your setup -- you're partitioning a single physical disk with LVM, and then individually formatting the LVs with btrfs. Why do this? Why not create a single BTRFS and use subvolumes if you want isolation? Better yet, why bother with the isolation? What are you hoping to get out of it?

Offline

#6 2014-09-25 13:23:34

das_j
Member
Registered: 2014-08-10
Posts: 4

Re: Troubles with having usr in an LVM

I don't know if there is an easier way to solve the generic problem I have. I have a SSD (sda) and a HDD (sdb). I can not put everything on the SSD because it is too small.
I also do stuff that writes a lot to the hard drive (like git rebase) so I want this suff on my HDD.

The SSD hosts my Grub  (What means it also has the Grub and EFI Partitions) and my root.
The HDD hosts /home, /opt, /srv, /usr, and /var.

When I planned this setup, there was no LVM, so I had sdb1-sdb5 for the partitions and sdb6 for my swap. It was also planned with ext4. That's why I don't use any of the cool new btrfs features.
The reason for the multiple partition is the fact that I can only mount one drive to one mount point. Maybe this is obsolete now.

A friend of mine said I could use LVM to be able to resize the partitions. That was where all the "fun" started.

Is it possible to solve this with btrfs?

Offline

#7 2014-09-25 14:15:03

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Troubles with having usr in an LVM

das_j wrote:

I also do stuff that writes a lot to the hard drive (like git rebase) so I want this suff on my HDD.

sigh...

das_j wrote:

A friend of mine said I could use LVM to be able to resize the partitions. That was where all the "fun" started.

Is it possible to solve this with btrfs?

The btrfs solution would employ subvolumes. There's no need to ever resize a subvolume because the full capacity of the backing device is shared amongst subvolumes. You can limit this with quotas, if you so desire...

Offline

Board footer

Powered by FluxBB