Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

fstab cant mount my encrypted /home partition

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

fstab cant mount my encrypted /home partition

  • Quote

Post by picarica » Sat Nov 02, 2019 1:19 pm

ill try to put as much information i can here but here is whole sotry discusser

here is the video i'll be mentioning throughout this post

so the problem is that fstabk cannot moun /dev/mapper/vg0-home it saus that its possibly non existent, even tho it's opened with dmcrypt before
after this failes i have to CTRL+ALT+F2 sign in as root and write

Code: Select all

mount /dev/mapper/vg0-home /home
which somehow exists now :/
i tried labeing it as 'home' in dmcrypt but still i have vg0-home in mapper,

i cannot mount 'home' in ampper because i get wrong fs error

here is my fstab
here is my dmcrypt config, you see it labeled as 'home'
here is my lvm config but i dont things its used :/
here is my blkid you see home mounted as LVM2 memebr? which i dont know what is and vg0-home as ext4 which is correct
here is df -h command, 'home' isnt even listed here
here is my fdisk -l also dev/sda/3 is the /home encrypted partition
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Nov 02, 2019 2:51 pm

picarica,

I think its a timing issue. Here is a test. Its not a fix, even if it appears to be.

Make a new file is /etc/local.d/ call it mnt_home.start
Inside that file put

Code: Select all

#!/bin/bash/
mount /dev/mapper/vg0-home /home
Once it exists. chmod +x it as it will be run as root.

localmount which reads /etc/fstab runs quite early is the boot process. Mounting home will still fail here.
local is the last process started before login, after everything else starts, so if its a timing thing, it should work here.

lvm2 is involved as device mapper provides the 'container' for your encrypted volume.
You donate one or more block devices to a LVM volume group. Then you create Logical Volumes inside that volume group.
Your volume group is called vg0 and the logical volume inside it is called home. Hence vg0-home.

Try the commands pvdisplay and lvdisplay.

If your logical volumes are not available before localmount is run, then fstab cannot mount any logical volumes.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Nov 02, 2019 4:26 pm

Please don't use videos or Firefox Send for error messages. It expires too quickly, and requires Javascript. Instead, post inline or pastebin text of the relevant errors, so that they are searchable and quotable.

From init scripts here:
  • Code: Select all

    depend() {
            before checkfs fsck
  • Code: Select all

    depend()
    {
            need fsck
As I read this, dmcrypt must be before fsck. localmount must be after fsck, since localmount needs fsck. Thus, dmcrypt must run before localmount, so the device must be ready.

Since you have LVM inside LUKS, you need to run LVM discovery after the LUKS unlock and before mount. This bold qualifier is likely what is missing for you. Change the dependency relations so that openrc starts components in the right sequence.
Top
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

  • Quote

Post by picarica » Sun Nov 03, 2019 7:02 pm

NeddySeagoon wrote:picarica,

I think its a timing issue. Here is a test. Its not a fix, even if it appears to be.

Make a new file is /etc/local.d/ call it mnt_home.start
Inside that file put

Code: Select all

#!/bin/bash/
mount /dev/mapper/vg0-home /home
Once it exists. chmod +x it as it will be run as root.

localmount which reads /etc/fstab runs quite early is the boot process. Mounting home will still fail here.
local is the last process started before login, after everything else starts, so if its a timing thing, it should work here.

lvm2 is involved as device mapper provides the 'container' for your encrypted volume.
You donate one or more block devices to a LVM volume group. Then you create Logical Volumes inside that volume group.
Your volume group is called vg0 and the logical volume inside it is called home. Hence vg0-home.

Try the commands pvdisplay and lvdisplay.

If your logical volumes are not available before localmount is run, then fstab cannot mount any logical volumes.
i found out very intresting things

Code: Select all

doas lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg0/home
  LV Name                home
  VG Name                vg0
  LV UUID                nMgTrk-Pn12-ldjH-Zajs-Kzfg-ExTG-rqG5K5
  LV Write Access        read/write
  LV Creation host, time xubuntu, 2019-10-15 18:49:11 +0200
  LV Status              available
  # open                 1
  LV Size                457.79 GiB
  Current LE             117195
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1
if my real home is /dev/vg0/home should i mount this ?

also my VG is correct as vg0

Code: Select all

doas vgdisplay
  --- Volume group ---
  VG Name               vg0
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               457.79 GiB
  PE Size               4.00 MiB
  Total PE              117195
  Alloc PE / Size       117195 / 457.79 GiB
  Free  PE / Size       0 / 0
  VG UUID               nlTc0k-J0Rf-IIgo-KUbz-i3iV-UAXO-hJztgI

what does this means ?
Top
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

  • Quote

Post by picarica » Sun Nov 03, 2019 7:03 pm

Hu wrote:Please don't use videos or Firefox Send for error messages. It expires too quickly, and requires Javascript. Instead, post inline or pastebin text of the relevant errors, so that they are searchable and quotable.

From init scripts here:
  • Code: Select all

    depend() {
            before checkfs fsck
  • Code: Select all

    depend()
    {
            need fsck
As I read this, dmcrypt must be before fsck. localmount must be after fsck, since localmount needs fsck. Thus, dmcrypt must run before localmount, so the device must be ready.

Since you have LVM inside LUKS, you need to run LVM discovery after the LUKS unlock and before mount. This bold qualifier is likely what is missing for you. Change the dependency relations so that openrc starts components in the right sequence.
not sure if wrong i edited localmount and put in need dmcrypt, but it still failed to mount :/
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Nov 03, 2019 7:38 pm

picarica,

Did you try my test?
What does

Code: Select all

rc-update show -v
output?

I suspect that your install uses LVM as a container for your LUKS volume.
That means the LUKS volume is not any physical block device as it will only appear once the physical block device is unlocked.

Its not quite that straight forward as LUKS inside LVM works as does LVM inside LUKS.
We don't know which you have. The ordering of the layers matters, since they must be started in the right order.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

  • Quote

Post by picarica » Sun Nov 03, 2019 7:54 pm

yall will mind if i upload my whole /etc ?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Nov 03, 2019 8:00 pm

picarica,

Not with 7z and not with Firefox send.
Most of it is not useful ether.

Answer the questions and post the things we ask for on a pastebin site if they are too big for a post.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

  • Quote

Post by picarica » Sun Nov 03, 2019 8:18 pm

NeddySeagoon wrote:picarica,

Did you try my test?
What does

Code: Select all

rc-update show -v
output?

I suspect that your install uses LVM as a container for your LUKS volume.
That means the LUKS volume is not any physical block device as it will only appear once the physical block device is unlocked.

Its not quite that straight forward as LUKS inside LVM works as does LVM inside LUKS.
We don't know which you have. The ordering of the layers matters, since they must be started in the right order.
well i did put the file where u said and chmodded it, rebooted and i have this as rc-update show -v
seems pretty normal to me, and how can i show how i have those layers ordered?

now i notcied too that i have lvm in boot runlevel and default, could that be making any problems ?


what's next?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Nov 03, 2019 10:53 pm

picarica,

You have

Code: Select all

localmount | boot
Good thats normal and you have

Code: Select all

lvm | boot default
only boot matters and

Code: Select all

dmcrypt | boot
looks good too.
I was also expecting to see device-mapper in the boot runlevel but it may be started by one of the other things.

Did my test appear to fix /home mounting?
It does the same thing as you logging in and running the command by hard.

I don't know how to determine the layer order except by trial and error and you can only do that once it works.
Then you can start all the layers one at a time. There are only two orders to try.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

  • Quote

Post by picarica » Mon Nov 04, 2019 10:24 am

NeddySeagoon wrote:picarica,

You have

Code: Select all

localmount | boot
Good thats normal and you have

Code: Select all

lvm | boot default
only boot matters and

Code: Select all

dmcrypt | boot
looks good too.
I was also expecting to see device-mapper in the boot runlevel but it may be started by one of the other things.

Did my test appear to fix /home mounting?
It does the same thing as you logging in and running the command by hard.

I don't know how to determine the layer order except by trial and error and you can only do that once it works.
Then you can start all the layers one at a time. There are only two orders to try.
and your test doesnt do anything for me, i still have to manually mount it like before :/

also what exacly do you mean by changing orders ? like editing files in init.d and changin need dependencies ?
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Mon Nov 04, 2019 2:26 pm

picarica wrote:also what exacly do you mean by changing orders ? like editing files in init.d and changin need dependencies ?
No, this will vanish as soon as the init.d is update

To do that, create a /etc/conf.d/nameofservice or update the file and add needed stuff you wish modify within it
ie:

Code: Select all

cat /etc/conf.d/lvm
rc_need="udev"
rc_after="dmcrypt"
...
Top
picarica
Guru
Guru
Posts: 366
Joined: Sat Aug 11, 2018 12:41 am

  • Quote

Post by picarica » Fri Nov 08, 2019 1:48 pm

fixed it by adding

Code: Select all

mount /dev/mapper/vg0-home /home

in /etc/local.d/mnt_home.start
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Nov 08, 2019 7:15 pm

picarica,

That's a hack, not a fix. :)
The real fix is to address the service start up order.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Post Reply

14 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic