Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
question about FSTAB file usage
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mikefot
Guru
Guru


Joined: 19 Nov 2014
Posts: 351

PostPosted: Wed Jul 18, 2018 8:48 am    Post subject: question about FSTAB file usage Reply with quote

Dear Folks,

I have a general question about the FSTAB file.

In gentoo installation would there ever be a reason to include partitions containing other linux distributions (e.g. debian or ubuntu etc)
in the FSTAB file or is it only meant to have say the swap file and root directory partitions that are specific to the gento installation itself?

How exhaustive does it need to be?

Also if it is missing things, wouldn't that possibly contribute to e.g. a kernel panic caused by being unable to mount the root file system
or some other major problem that repeated kernel compilations could not solve until the FSTAB file entries were corrected?

General comments and recommendations welcome here.

Regards

Michael Fothergill
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5692

PostPosted: Wed Jul 18, 2018 1:13 pm    Post subject: Reply with quote

you only need what you need to boot the system, everything after that is optional.
_________________
overlay | patches
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5140
Location: The Peanut Gallery

PostPosted: Wed Jul 18, 2018 3:44 pm    Post subject: Re: question about FSTAB file usage Reply with quote

mikefot wrote:
In gentoo installation would there ever be a reason to include partitions containing other linux distributions (e.g. debian or ubuntu etc)
in the FSTAB file or is it only meant to have say the swap file and root directory partitions that are specific to the gento installation itself?
That is entirely up to you; any reason would be yours.
You can put in whatever is convenient at your installation.
mikefot wrote:
How exhaustive does it need to be?
As bunder said, enough to boot your machine, meaning anything needed for localmount (the openrc service), a standard milestone in any init sequence.
So if you have /usr and /var on separate partitions, they would definitely need to be listed for mount -a, as would any separated out /usr/local and /var/tmp.
/tmp is often on tmpfs, if not a separate partition, so that gets listed too.
mikefot wrote:
Also if it is missing things, wouldn't that possibly contribute to e.g. a kernel panic caused by being unable to mount the root file system
Not that specific problem, which is the kernel trying to access the root (or real_root) partition when booting; the partition where mount would read /etc/fstab from, once booted up.
That one either means the user has forgotten a kernel cmdline parm, so they need to edit it in their bootloader config (rEFInd is excellent), or more commonly on Gentoo, they have not builtin the drivers for the hard-disk controller, or for the rootfs (such as ext4) which should be built-in to the kernel, not as module. (Y, not M.)
mikefot wrote:
or some other major problem that repeated kernel compilations could not solve until the FSTAB file entries were corrected?
Well, it absolutely won't work if you don't have /usr mounted, for example, and the same applies to /var ime.
So yes, it is essential to get right.

OTOH it's pretty much fire-and-forget, until you change hardware.
At which point, you're opening the machine up, so you are already in the correct frame of mind to make any required config changes, and you have the existing file with a few comments you wrote last time, as a basis to work from.

Personally, I recommend people use lvm to allow them to allocate space as needed later on, and as many partitions as they like. (I use quite a few, fwtw.)
A "/mnt/shared" partition is useful if you have more than one OS bootable, and /mnt/backup is essential; that is noauto or unlisted, and only mounted by root when needed.

I also recommend a separate /boot partition, noauto, as common in Gentoo for years, and nowadays a separate EFI partition (vfat) to boot rEFInd from, as well as a separate 1G space for sysresccd. (boots very quickly, and always handy. also much more secure than any other livedisk, ime.)

Also, if you must use a uuid to boot the kernel, or in /etc/fstab for some other reason, use PARTUUID which the kernel knows without any modules at all. (not UUID which requires userspace, or at least the fs module and read of the data, and changes when you reformat.)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Jul 18, 2018 5:57 pm    Post subject: Reply with quote

mikefot,

/etc/fstab is on the root filesysem, so cannot be read until root is mounted.
It follows that it can play no part in mounting root, ro but it does it he remount rw.
rootfsck uses it to determine the file system checker to run.
Listing the wrong filesystem type makes rootfsck fail and root stays read only.
The root filesystem location is set by the root= kernel command line parameter.

Anything you you always need mounted should be listed here.
/boot can be noauto and removable media drives must be noauto.
You can test that for yourself.

After that its all optional. However, fstab entries allow the lazy form of mount to be used
Specifiy either the what or the where but not both.
Together with the user or users option, unprivileged uners can be permitted to mount and unmount volumes listed in fstab.
_________________
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
mikefot
Guru
Guru


Joined: 19 Nov 2014
Posts: 351

PostPosted: Sat Jul 21, 2018 7:21 pm    Post subject: Reply with quote

Many thanks for the responses here.

Regards

MF
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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