Compréhension systemctl et fstab

Tags: #<Tag:0x00007f2c9aff0848>

Hello,

J’ai un souci de compréhension avec la fin de fstab si j’ai bien compris.
J’ai un disk ci dessous qui est monté sur /mnt/diskint

Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20SPZX-08U
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 36D5D724-6C3C-11EE-BEDD-FB7DEB7F4ECA

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 3907029127 3907027080  1.8T Linux filesystem

Je voudrais le retirer donc je suis allé dans le fstab mais pas présent.

root@pve:/mnt/diskint/bkpvmpve/dump# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/pve/root / ext4 errors=remount-ro 0 1
/dev/sdb1       /mnt/usb        ext4    defaults        0 2
/dev/sdc1       /mnt/usb1       ext4    defaults        0 2
UUID=F9FD-3DC1 /boot/efi vfat defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0
root@pve:/mnt/diskint/bkpvmpve/dump#

J’ai donc fait ceci pour trouver un service « .mount »

root@pve:/mnt/diskint/bkpvmpve/dump# systemctl list-units | grep mount
  mnt-pcloud.automount                                                                                       loaded active     running   Mount personal Nextcloud WebDAV automount
  proc-sys-fs-binfmt_misc.automount                                                                          loaded active     running   Arbitrary Executable File Formats File System Automount Point
  -.mount                                                                                                    loaded active     mounted   Root Mount
  boot-efi.mount                                                                                             loaded active     mounted   /boot/efi
  dev-hugepages.mount                                                                                        loaded active     mounted   Huge Pages File System
  dev-mqueue.mount                                                                                           loaded active     mounted   POSIX Message Queue File System
  etc-pve.mount                                                                                              loaded active     mounted   /etc/pve
  mnt-diskint.mount                                                                                          loaded active     mounted   /mnt/diskint
  mnt-pcloud.mount                                                                                           loaded active     mounted   Mount personal Pcloud WebDAV
  mnt-usb.mount                                                                                              loaded active     mounted   /mnt/usb
  mnt-usb1.mount                                                                                             loaded active     mounted   /mnt/usb1
  proc-sys-fs-binfmt_misc.mount                                                                              loaded active     mounted   Arbitrary Executable File Formats File System
  run-credentials-systemd\x2dsysctl.service.mount                                                            loaded active     mounted   /run/credentials/systemd-sysctl.service
  run-credentials-systemd\x2dsysusers.service.mount                                                          loaded active     mounted   /run/credentials/systemd-sysusers.service
  run-credentials-systemd\x2dtmpfiles\x2dsetup.service.mount                                                 loaded active     mounted   /run/credentials/systemd-tmpfiles-setup.service
  run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount                                          loaded active     mounted   /run/credentials/systemd-tmpfiles-setup-dev.service
  run-rpc_pipefs.mount                                                                                       loaded active     mounted   RPC Pipe File System
  run-user-0.mount                                                                                           loaded active     mounted   /run/user/0
  sys-fs-fuse-connections.mount                                                                              loaded active     mounted   FUSE Control File System
  sys-kernel-config.mount                                                                                    loaded active     mounted   Kernel Configuration File System
  sys-kernel-debug.mount                                                                                     loaded active     mounted   Kernel Debug File System
  sys-kernel-tracing.mount                                                                                   loaded active     mounted   Kernel Trace File System
  var-lib-lxcfs.mount                                                                                        loaded active     mounted   /var/lib/lxcfs
  systemd-remount-fs.service                                                                                 loaded active     exited    Remount Root and Kernel File Systems
  zfs-mount.service                                                                                          loaded active     exited    Mount ZFS filesystems

Beaucoup de choses donc je filtre avec disk:

root@pve:/mnt/diskint/bkpvmpve/dump# systemctl list-units | grep disk
  mnt-diskint.mount                                                                                          loaded active     mounted   /mnt/diskint
  systemd-fsck@dev-disk-by\x2duuid-F9FD\x2d3DC1.service                                                      loaded active     exited    File System Check on /dev/disk/by-uuid/F9FD-3DC1

Je désactive mnt-diskint.mount

root@pve:/mnt/diskint/bkpvmpve/dump# systemctl disable mnt-diskint.mount
Failed to disable unit: Unit file mnt-diskint.mount does not exist.

Cela ne fonctionne pas et je m’embrouille dans désactivant autre chose:

root@pve:/mnt/diskint/bkpvmpve/dump# systemctl disable systemd-fsck@dev-disk-by\x2duuid-F9FD\x2d3DC1.service

Erreur, je tente de réactiver:

    root@pve:/mnt/diskint/bkpvmpve/dump# systemctl enable systemd-fsck@dev-disk-by\x2duuid-F9FD\x2d3DC1.service
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.

Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/, .requires/, or .upholds/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

J’ai du coup 2 questions:

Comment réactiver le service systemd-fsck@dev-disk-by\x2duuid-F9FD\x2d3DC1.service
Comment désactiver le montage sur mnt/diskint

Merci pour votre support.

Bonjour
Ta machine est un proxmox? IL faudrait commencer par donner ce genre d’information. Il vaut mieux être précis sur l’environnement de départ et les conditions existante, pour qu’on puisse comprendre le problème.

Idem: Ton disque /dev/sda est un disque externe?

Pour voir les disques montés il suffit d’un simple mount tout court.

Bonjour et merci Zargos.

Oui en effet ma machine est un proxmox avec le disque en /dev/sda.
L’OS est installé sur un disque flash.

root@pve:/mnt/diskint/bkpvmpve/dump# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=32811368k,nr_inodes=8202842,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=6569008k,mode=755,inode64)
/dev/mapper/pve-root on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18995)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/nvme0n1p2 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
/dev/fuse on /etc/pve type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
systemd-1 on /mnt/pcloud type autofs (rw,relatime,fd=37,pgrp=1,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=3657337)
https://ewebdav.pcloud.com/ on /mnt/pcloud type fuse (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,allow_other,max_read=16384,uid=0,gid=0,_netdev,helper=davfs)
/dev/sdb1 on /mnt/usb type ext4 (rw,relatime)
/dev/sda1 on /mnt/diskint type ext4 (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=6569004k,nr_inodes=1642251,mode=700,inode64)
/dev/sdc1 on /mnt/usb1 type ext4 (rw,relatime)
root@pve:/mnt/diskint/bkpvmpve/dump#