You are not logged in.

#1 2021-10-26 20:05:28

Automath
Member
Registered: 2016-05-16
Posts: 115

Searching for an optimal setting for fstab

Nothing fewer than that should be allowed in my case.

Hello, I'm now setting how the drives should be mounted for security and practicity, reading over fstab https://wiki.archlinux.org/title/fstab and filesystem options I collected a bunch of usefull stuff and I wan't you to tell me if they will do as I expect:

LABEL=Mio                                    /disks/Mio     ext4             rw,user,x-mount.mkdir,relatime,noauto,errors=remount-ro,systemd.idle-timeout=120min  0 0
#dump bit sirve para hacer backups con dump leer al respecto!
#pass bit define si el disco debe checkearse en el inicio del sistema, si se trata de un disco de sistema el bit 1 habiliatara esta función
# y el bit 2 hara lo mismo para el resto de los discos, el bit 0 desabilita la función para todos los casos
###relatime actualiza las fechas de acceso de archivo una vez cada 24 hs
#noauto evita la carga automática al inicio
#x-systemd.idle-timeout=Xmin desmonta automaticamente el disco luego estar inactivo X minutos.
#errors=remount-ro En caso de error marca el sistema de archivos como de solo lectura
#user habilita a cualquiera a montar el disco

I google autotranslated my note in Spanish because sorry I'm relly lazy:

#dump bit is used to make backups with dump read about it!
#pass bit defines if the disk should be checked at system startup, if it is a system disk, bit 1 will enable this function
# and bit 2 will do the same for the rest of the disks, bit 0 disables the function for all cases
### relatime updates file access dates once every 24 hours
#noauto prevents automatic loading at startup
# x-systemd.idle-timeout = Xmin automatically unmounts the disk after being idle for X minutes.
# errors = remount-ro In case of error marks the file system as read-only
#user enables anyone to mount the disk

What I want indeed is to allow any user normal to mount the drive on demand, not on startup, at the folder specified wich the system would create and remove every time (udisks way, no unnecessary empty folders), not to allow the drive to mount if it has errors and if it does and it's already mounted to remount it as read only, also to unmount it if it's not on use, and finally to have access to it using my normal user.

What is more unclear for me is weather I should use the option x-systemd.automount:
from the page it says:

This will fsck and mount the partition only when it is first accessed

What does it means with "first accessed"?
Also in the man page for mount:

X-mount.mkdir[=mode]
Allow to make a target directory (mountpoint) if it does not exit yet. The optional argument mode specifies the filesystem access mode used for mkdir(2) in octal notation. The default mode is 0755. This functionality is supported only for root users or when mount executed without suid permissions. The option is also supported as x-mount.mkdir, this notation is deprecated since v2.30.

Which mode should I specify to allow my normal user to do stuff on the disk?
Also how should I mount a partition set in fstab as no auto?
would it simply:

mount /dev/sdX

with no further options?

Last edited by Automath (2021-10-26 20:12:01)

Offline

Board footer

Powered by FluxBB