Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]Need guidance for /etc/fstab
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
gardenair
n00b
n00b


Joined: 05 Oct 2021
Posts: 72

PostPosted: Sat Mar 30, 2024 1:24 am    Post subject: [Solved]Need guidance for /etc/fstab Reply with quote

I have created five partitions for a DOS/Legacy BIOS system

Code:
/dev/sda1    /boot
/dev/sda2   swap
/dev/sda3   /
/dev/sda4   extended
/dev/sda5   /home


I have three queries
1- In /etc/fstab is there a need to add an extended partition as well, if yes what parameters may I add?
2- Please also guide me for /dev/sda5 (home partition) . Are the parameters correct?
3-Is there a need to add UUID with each partition in /etc/fstab ? If yes how may I fatch it?

https://ibb.co/Tt8GYLR
https://ibb.co/Wz5xxMj
https://ibb.co/XjR9xpt

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/System#DOS/Legacy_BIOS_systems


Last edited by gardenair on Mon Apr 01, 2024 6:48 am; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1935

PostPosted: Sat Mar 30, 2024 2:59 am    Post subject: Reply with quote

Make sure you have 6 columns for each fstab entry. Currently, it seems you have combined the 5th and 6th together. There needs to be a space between the numbers.
Back to top
View user's profile Send private message
gardenair
n00b
n00b


Joined: 05 Oct 2021
Posts: 72

PostPosted: Sat Mar 30, 2024 10:44 am    Post subject: Reply with quote

Yes, it was my mistake.

https://ibb.co/tmn07c5
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5184
Location: Bavaria

PostPosted: Sat Mar 30, 2024 12:11 pm    Post subject: Re: Need guidance for /etc/fstab Reply with quote

gardenair wrote:
1- In /etc/fstab is there a need to add an extended partition as well, if yes what parameters may I add?

No.
gardenair wrote:
3-Is there a need to add UUID with each partition in /etc/fstab ? If yes how may I fatch it?

It is not a must, so you can stay with /dev/sdaX ... it is recommended because:
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Kernel_Commandline_Parameter#Parameter:_root.3D
and you will get it with "blkid".
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3007
Location: Edge of marsh USA

PostPosted: Sun Mar 31, 2024 3:43 am    Post subject: Reply with quote

Since you are only using four partitions, you don't need an extended partition. Simply things and just make four primary partitions.

You don't need a separate boot partition. A separate boot partition adds unnecessary complexity.

For the way I use UUID in the fstab, see the following:
Code:
#was /dev/sda1
UUID=5958fd45-723e-4d6b-9253-e74dada52d45   /   ext4   noatime   0 1
#was /dev/sda2
UUID=dddc386d-1e50-4d4a-996f-126efcbc4c91   /home   ext4   user,exec,noatime   0 2

For finding the UUID:
Code:
$ ls -l /dev/disk/by-uuid/

Edited for presentation and thoroughness.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi


Last edited by figueroa on Sun Mar 31, 2024 4:20 pm; edited 2 times in total
Back to top
View user's profile Send private message
gardenair
n00b
n00b


Joined: 05 Oct 2021
Posts: 72

PostPosted: Sun Mar 31, 2024 11:40 am    Post subject: Reply with quote

Thanks once again. As I am going ahead Gentoo is opening a new topic/world. It is a sea. It is a reality that If someone wants to learn Linux he/she must use Gentoo and play with it. Each topic is itself a complete book.
Well "figueroa" I use separate boot partitions as I see in most cases on tutorials they make. One thing I know is that making separate "/boot" is used when we need more than one Linux kernel. (If I am correct).
In your home partition, there is " user, exec,noatim". exec means " (allow executing binaries and scripts) what do "user and noatim mean?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 31, 2024 1:11 pm    Post subject: Reply with quote

gardenair,

exec means that things can be executed from that location. As its the default, it need not be included in fstab.
Think about using noexec in places to deny an attacker opportunities to run programs. Even on /home if your users are not trusted.

user allows any user to mount and the same user to unmount the filesystem. Its only useful on optical media.
A logged in user cannot unmount /home as they will always have an open file there that they cannot close without logging out.

noatime (you missed the e) does not record the time the file was last accessed in the directory. This saves a lot of directory writes.
That's good on SSD and a small speed improvement too.

For the rationale behind a small /boot partition at the start of the drive you need no understand something of the history of the PC. It "just grew" and was never designed to be the way it is now.

== edit ==

Using kernel assigned device names like /dev/sda1 is fine and safe while there is only one device. The kernel assigns names in device detection order, so with two or devices (sda and sdb) naming is not deterministic. They may be swapped. The UUID is a unique property of a filesystem, so that always works 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
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22771

PostPosted: Sun Mar 31, 2024 3:25 pm    Post subject: Reply with quote

gardenair wrote:
One thing I know is that making separate "/boot" is used when we need more than one Linux kernel. (If I am correct).
No, this is not correct. There are good reasons why someone may want a separate /boot partition, but the number of kernels stored is not a factor in deciding whether it is necessary.
gardenair wrote:
In your home partition, there is " user, exec,noatim". exec means " (allow executing binaries and scripts) what do "user and noatim mean?
noatim is a presentation error. It looks like the code block was copied from an editor that did line wrapping strangely, so the line after noatim should be joined to the noatim line. Neddy answered your question about user, but I want to add some additional commentary.
  • user looks weird to me here. It is typically used for removable media, so that a person can walk up, plug in media (floppy disk, CD-ROM, or USB mass storage), then use an unprivileged terminal to mount it. Using it on an internal device, especially one that is not noauto does not seem useful to me.
  • exec is the default as Neddy says - but with a caveat. user implies noexec, so if exec is desired on a user mount, then the administrator must explicitly list exec after user to override the implicit noexec from user. This is for security reasons, as running programs from removable media may be considered a higher security hazard, so it is disabled by default.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3007
Location: Edge of marsh USA

PostPosted: Sun Mar 31, 2024 4:19 pm    Post subject: Reply with quote

gardenair
There are man pages for fstab and mount, and, of course, bottomless internet resources.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
gardenair
n00b
n00b


Joined: 05 Oct 2021
Posts: 72

PostPosted: Mon Apr 01, 2024 7:36 am    Post subject: Reply with quote

Thanks all for guiding me.One thing more I want to add that when adding partition label by UUID then the user must awake in adding entry in his /etc/fstab
Example
Code:
#was /dev/sda1
UUID=5958fd45-723e-4d6b-9253-e74dada52d45   /   ext4   noatime   0 1


Here a minor mistake may effect the entry "UUID=5958fd45-723e-4d6b-9253-e74dada52d45 " so by writing UUID one must be careful in it. Where as by label /dev/sda1 /boot is simple and easy.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22771

PostPosted: Mon Apr 01, 2024 12:59 pm    Post subject: Reply with quote

You can more easily avoid such mistakes by never writing the UUID at all. Instead, you should get a tool to show you the UUID in a form that your editor can insert it into fstab without you ever typing any of digits of the UUID.
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1040

PostPosted: Mon Apr 01, 2024 3:06 pm    Post subject: Reply with quote

Look at genfstab
Code:
* sys-fs/genfstab
     Available versions:  24 28-r1^t {test}
     Homepage:            https://github.com/archlinux/arch-install-scripts https://man.archlinux.org/man/genfstab.8
     Description:         Genfstab - generate output suitable for addition to an fstab file

(or simple command line tool like blkid)
_________________
LRS 64/32 on G.Drive
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