Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/fstab and encrypted partition.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 246
Location: Toronto, Canada

PostPosted: Sat Jun 13, 2020 2:11 am    Post subject: /etc/fstab and encrypted partition. Reply with quote

/dev/sda1 is un-encrypted and is mounted at /boot
/dev/sda2 is encrypted ... and is the rootfs

What should i put in my /etc/fstab ? is the following correct:

Code:

/dev/sda1                             /boot       vfat    noatime 0 2
/dev/mapper/vg0-root                    /               ext4    noatime 0 1


or is using UUIDs a MUST ? like this:

Code:

UUID-of-/dev/sda1                     /boot       vfat    noatime 0 2
UUID-of-/dev/mapper/vg0-root            /               ext4    noatime 0 1
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3513

PostPosted: Sat Jun 13, 2020 6:16 am    Post subject: Re: /etc/fstab and encrypted partition. Reply with quote

AFAIK lvm does not understand UUID, so /dev/mapper/vg0-root should be ok.
For /boot you should not need an entry at all. If you want one for convenience, prefer PARTUUID over UUID.
Back to top
View user's profile Send private message
coderanger
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 150

PostPosted: Sat Jun 13, 2020 11:23 pm    Post subject: Reply with quote

If you use LVM on LUKS, and volumes are already activated before openrc run (e.g. by initrd) then you can use either UUID or device node /dev/mapper/vg0-root
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46310
Location: 56N 3W

PostPosted: Sun Jun 14, 2020 8:39 am    Post subject: Reply with quote

LegionOfHell,

For the root entry in fstab, use anything you like except a symbolic link.
The entry is only used by rootfsck to know the file system type.

Symlinks in fstab are a very bad thing.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 341
Location: Bavaria

PostPosted: Sun Jun 14, 2020 9:20 am    Post subject: Re: /etc/fstab and encrypted partition. Reply with quote

LegionOfHell wrote:
What should i put in my /etc/fstab ?

Copy your needed lines from this example:
Code:
# option "defaults" == "rw,suid,dev,exec,auto,nouser,async"
#

PARTLABEL=boot          /boot       vfat    defaults,noauto,noatime                         1 2
PARTLABEL=swap          none        swap    sw                                              0 0
/dev/mapper/vg0-root    /           ext4    defaults,noatime                                0 1

tmpfs           /tmp                tmpfs   rw,noexec,nodev,nosuid,mode=1777                0 0
tmpfs           /var/tmp/portage    tmpfs   rw,nodev,nosuid,size=10G,uid=portage,gid=portage,mode=775,noatime       0 0

... if you gave this partition-names to your partitions.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum