Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Luks - able to mount root without using fstab?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dman777
Veteran
Veteran


Joined: 10 Jan 2007
Posts: 1004

PostPosted: Wed Dec 20, 2017 4:58 pm    Post subject: Luks - able to mount root without using fstab? Reply with quote

On a new install, I encrypted my root partition in Luks. I have successfully completed the full Gentoo installation. I can boot from grub into my Gentoo system, enter Luks password, and successfully be in my system on the command line.

What is puzzling though, is that I have not placed the /dev/mapper/rootfs in my /etc/fstab. I am still able to boot into my system with the /dev/mapper/rootfs mounted as /. How is this possible? Am I truly not in my root file system even though it appears I am?
_________________
<h5>Checkout <em>#grandmasboy</em> on <em>freenode</em>...chat with jayP bot from the movie!</h5>
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Wed Dec 20, 2017 6:49 pm    Post subject: Reply with quote

well, you can kind of get away not putting the / filesystem in fstab. After all - in order to read the fstab, / must already be mounted.

you are probably passing that info via your bootloader as kernel parameter, and/or through initramfs, which mounts / for you.

of course, you should still put it in fstab in the end, if only to check that the correct thing is mounted and with the options.
Back to top
View user's profile Send private message
dman777
Veteran
Veteran


Joined: 10 Jan 2007
Posts: 1004

PostPosted: Wed Dec 20, 2017 8:25 pm    Post subject: Reply with quote

If it is not being used in fstab and that is confirmed, it should be removed.

Here is my reasoning.... if you do luks on a SSD, you will need to throw in the `allow-discards` in GRUB(root_trim=yes). A user may not do this and instead place the option in fstab, where that entry will never actually be used.

The consequence will be uneven wear on a expensive SSD with performance loss as a end result.

Who could I contact to have https://wiki.gentoo.org/wiki/Dm-crypt#Configuring_fstab removed?
_________________
<h5>Checkout <em>#grandmasboy</em> on <em>freenode</em>...chat with jayP bot from the movie!</h5>
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Wed Dec 20, 2017 8:59 pm    Post subject: Reply with quote

dman777 wrote:
If it is not being used in fstab


It is, in various ways. fstab is not just about mounting. Some file managers parse fstab entries to determine whether a path should be treated as an external/ejectable device or not, and stuff like that.

So you should still have the fstab entry, regardless whether it's required in early boot.
Back to top
View user's profile Send private message
dman777
Veteran
Veteran


Joined: 10 Jan 2007
Posts: 1004

PostPosted: Fri Dec 22, 2017 4:04 pm    Post subject: Reply with quote

Correct, I was confusing Luks options with mounting options.

For anyone that reads this:

rootfs_trim(allow-discards) is a LUKS command. The discard option in /etc/fstab for /dev/mapper/root is a mounting option and has nothing to do with LUKS. rootfs_trim(allow-discards) is needed regardless of the 'discard' option in /etc/fstab. In my case, I use both.
_________________
<h5>Checkout <em>#grandmasboy</em> on <em>freenode</em>...chat with jayP bot from the movie!</h5>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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