What is the absolute path to the file that contains all the drives, hardware and network shares, that are mounted by the system during boot?
Asked
Active
Viewed 867 times
1
-
I've flagged your question to close because it is not specific enough. Please explain more what kind of problem you try to solve. – MadMike Jun 04 '18 at 13:56
2 Answers
4
That is /etc/fstab
(for its syntax see man fstab
).
To be more precise it doesn't contain drives but filesystems to be mounted.

muclux
- 5,154
2
There is no single file that contains all drives, shares, etc. to be mounted at startup. /etc/fstab
is where you're supposed to add these, but in practice, any method for running a command on startup as root can be used for mounting.
In the systemd world, the canonical way to mount anything at boot would be using systemd mounts. In systemd, even entries in fstab
are converted to .mount
s by the systemd-fstab-generator
.
~ systemctl list-units --type=mount
UNIT LOAD ACTIVE SUB DESCRIPTION
-.mount loaded active mounted Root Mount
boot.mount loaded active mounted /boot
dev-hugepages.mount loaded active mounted Huge Pages File System
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
...
~ systemctl cat -- -.mount
# /run/systemd/generator/-.mount
# Automatically generated by systemd-fstab-generator
[Unit]
SourcePath=/etc/fstab
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Before=local-fs.target
[Mount]
Where=/
What=/dev/disk/by-uuid/e5018f7e-5838-4a47-b146-fc1614673356
Type=ext4
Options=rw,relatime,data=ordered

muru
- 197,895
- 55
- 485
- 740