[Risolto] Systemd: cancellare unit .device

Informazioni, consigli e novità sulla galassia delle distribuzioni GNU/Linux, *nix, *BSD e su altri sistemi operativi non liberi.
Avatar utente
GjMan78
Rampante Reduce
Rampante Reduce
Messaggi: 5884
Iscrizione: mercoledì 22 novembre 2006, 19:15
Desktop: KdePlasma
Distribuzione: EndeavourOS
Sesso: Maschile
Località: ~/Italia/Lazio/Viterbo/

[Risolto] Systemd: cancellare unit .device

Messaggio da GjMan78 »

Quando la domenica ho del tempo libero mi metto a fare quelle cose noiose che tendo sempre a rimandare.

Oggi era il turno di disattivare la partizione swap per passare ad uno swapfile. Vi anticipo che ha funzionato, lo swap funziona come dovrebbe ma all'avvio ho un noioso messaggio che non riesco ad eliminare.
Da qualche parte è rimasto un richiamo alla vecchia partizione swap che non riesco a trovare...

Immagine

Il mio SO è EndeavourOS, btrfs criptato con luks.

Vi riassumo i passaggi a grandi linee: ho creato il subvolume swap, creato al suo interno lo swapfile.

Codice: Seleziona tutto

sudo btrfs subvolume list -t /
ID	gen	top level	path	
--	---	---------	----	
256	38731	5		@_backup_20232408071029627
257	39006	5		@home
258	38966	5		@cache
259	39004	5		@log
260	4226	526		var/lib/portables
261	4226	526		var/lib/machines
264	38848	526		.snapshots
265	4235	264		.snapshots/1/snapshot
526	39006	5		@
625	38731	264		.snapshots/360/snapshot
626	38731	264		.snapshots/361/snapshot
627	38731	264		.snapshots/362/snapshot
628	38731	264		.snapshots/363/snapshot
629	38731	264		.snapshots/364/snapshot
630	38731	264		.snapshots/365/snapshot
631	38731	264		.snapshots/366/snapshot
632	38731	264		.snapshots/367/snapshot
633	38731	264		.snapshots/368/snapshot
634	38731	264		.snapshots/369/snapshot
635	38731	264		.snapshots/370/snapshot
636	38731	264		.snapshots/371/snapshot
637	38731	264		.snapshots/372/snapshot
638	38731	264		.snapshots/373/snapshot
639	38731	264		.snapshots/374/snapshot
640	38731	264		.snapshots/375/snapshot
641	38731	264		.snapshots/376/snapshot
642	38731	264		.snapshots/377/snapshot
643	38731	264		.snapshots/378/snapshot
644	38731	264		.snapshots/379/snapshot
645	38731	264		.snapshots/380/snapshot
646	38731	264		.snapshots/381/snapshot
647	38731	264		.snapshots/382/snapshot
648	38731	264		.snapshots/383/snapshot
649	38731	264		.snapshots/384/snapshot
650	38731	264		.snapshots/385/snapshot
651	38740	5		@swap
652	38794	264		.snapshots/386/snapshot
653	38796	264		.snapshots/387/snapshot
654	38823	264		.snapshots/388/snapshot
655	38825	264		.snapshots/389/snapshot

Ho provveduto a modificare il file /etc/fstab rimuovendo la riga relativa alla partizione ed inserendo il subvolume.

Codice: Seleziona tutto

cat /etc/fstab

UUID=BC78-4354                            /boot/efi      vfat    defaults,noatime 0 2
/dev/mapper/luks-fd085464-4840-43bd-a55b-e1713c6c5a4f /              btrfs   subvol=/@,defaults,noatime,compress=zstd 0 0
/dev/mapper/luks-fd085464-4840-43bd-a55b-e1713c6c5a4f /home          btrfs   subvol=/@home,defaults,noatime,compress=zstd 0 0
/dev/mapper/luks-fd085464-4840-43bd-a55b-e1713c6c5a4f /var/cache     btrfs   subvol=/@cache,defaults,noatime,compress=zstd 0 0
/dev/mapper/luks-fd085464-4840-43bd-a55b-e1713c6c5a4f /var/log       btrfs   subvol=/@log,defaults,noatime,compress=zstd 0 0

# swapfile
/dev/mapper/luks-fd085464-4840-43bd-a55b-e1713c6c5a4f /swap          btrfs   noatime,subvol=@swap
/swap/swapfile none swap defaults 0 0

tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
Ho controllato la configurazione di dracut ed ho rimosso il richiamo alla partizione eliminata.

Codice: Seleziona tutto

cat /etc/dracut.conf.d/calamares-luks.conf
File: /etc/dracut.conf.d/calamares-luks.conf
# Configuration file automatically written by the Calamares system installer
# (This file is written once at install time and should be safe to edit.)
# Enables support for LUKS full disk encryption with single sign on from GRUB.

# force installing /etc/crypttab even if hostonly="no", install the keyfile
install_items+=" /etc/crypttab /crypto_keyfile.bin "
# enable automatic resume from swap
#add_device+=" /dev/disk/by-uuid/b7e0858a-5114-45d2-a976-7af690655243 "
Ho rimosso da Grub ogni riferimento alla partizione swap

Codice: Seleziona tutto

cat /etc/default/grub
# GRUB boot loader configuration

GRUB_DEFAULT='0'
GRUB_TIMEOUT='5'
GRUB_DISTRIBUTOR='EndeavourOS'
GRUB_CMDLINE_LINUX_DEFAULT='nowatchdog nvme_load=YES rd.luks.uuid=fd085464-4840-43bd-a55b-e1713c6c5a4f loglevel=3'
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY='true'

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
GRUB_BACKGROUND='/usr/share/endeavouros/splash.png'
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
GRUB_DISABLE_SUBMENU='false'

# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
#GRUB_DISABLE_OS_PROBER=false
Come dicevo funziona tutto, ma all'avvio devo attendere il grace time di systemd prima che il sistema parta.

Codice: Seleziona tutto

systemctl status dev-disk-by\\x2duuid-b7e0858a\\x2d5114\\x2d45d2\\x2da976\\x2d7af690655243.device 
○ dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device - /dev/disk/by-uuid/b7e0858a-5114-45d2-a976-7af690655243
     Loaded: loaded
     Active: inactive (dead)

set 03 18:43:06 macbookpro systemd[1]: dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device: Job dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device/start timed out.
set 03 18:43:06 macbookpro systemd[1]: Timed out waiting for device /dev/disk/by-uuid/b7e0858a-5114-45d2-a976-7af690655243.
set 03 18:43:06 macbookpro systemd[1]: dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device: Job dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device/start failed with result 'timeout'.
Dimenticavo di dire che ovviamente ho aggiornato tutto con

Codice: Seleziona tutto

sudo grub-mkconfig -o /boot/grub/grub.cfg 

Codice: Seleziona tutto

sudo dracut-rebuild
Ultima modifica di GjMan78 il domenica 3 settembre 2023, 23:09, modificato 1 volta in totale.
MacBook Pro - Intel i5-3210 - 16 Gbyte Ram DDR3 - SSD 500 Gbyte x 2
»»» 𝗙𝗮𝗶 𝗶𝗹 𝗕𝗮𝗰𝗸𝘂𝗽! ¯\_(ツ)_/¯
Avatar utente
wilecoyote
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 15720
Iscrizione: giovedì 20 agosto 2009, 16:21
Desktop: Kubuntu et alii
Distribuzione: 9.04 32bit 14/18/20/22.04 LTS 64bit
Sesso: Maschile
Località: Ceranesi - Ge

Re: Systemd: cancellare unit .device

Messaggio da wilecoyote »

:) Salve, per trovare nel sistema il richiamo usa il comando:

Codice: Seleziona tutto

grep -ri 'b7e0858a-5114--45d2-a976-7af690655243' /*
Verifica la congruità del codice esadecimale, fra la qualità scarsa della foto e la mia vista se possibile anche più scarsa, probabilmente ho commesso qualche errore nel copiarlo.

Se in qualche file c'è un riferimento, ti verrà mostrata la relativa path.

:ciao: Ciao
ACER Extensa 5230E 2,2 Ghz cpu Celeron 900 hdd 160 GB Ram 1 GB scheda video Intel GM500
ACER Extensa 5635Z 2,2 Ghz cpu Celeron T3100 hdd 320 GB Ram 4 GB scheda video Intel Mobile 4
Quando una Finestra chiusa incontra un Pinguino la Finestra chiusa è una Finestra aperta.
Avatar utente
GjMan78
Rampante Reduce
Rampante Reduce
Messaggi: 5884
Iscrizione: mercoledì 22 novembre 2006, 19:15
Desktop: KdePlasma
Distribuzione: EndeavourOS
Sesso: Maschile
Località: ~/Italia/Lazio/Viterbo/

Re: Systemd: cancellare unit .device

Messaggio da GjMan78 »

@wilecoyote
Grazie del consiglio ma non è servito, probabilmente perché la unit viene generata dinamicamente.

Sono però riuscito a risolvere con un semplice

Codice: Seleziona tutto

sudo systemctl mask 'dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device'
Non sono sicuro che sia la soluzione migliore o la più elegante ma funziona,
MacBook Pro - Intel i5-3210 - 16 Gbyte Ram DDR3 - SSD 500 Gbyte x 2
»»» 𝗙𝗮𝗶 𝗶𝗹 𝗕𝗮𝗰𝗸𝘂𝗽! ¯\_(ツ)_/¯
Avatar utente
wilecoyote
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 15720
Iscrizione: giovedì 20 agosto 2009, 16:21
Desktop: Kubuntu et alii
Distribuzione: 9.04 32bit 14/18/20/22.04 LTS 64bit
Sesso: Maschile
Località: Ceranesi - Ge

Re: [Risolto] Systemd: cancellare unit .device

Messaggio da wilecoyote »

:) Salve, bene che hai risolto.

1 curiosità, perché hai usato mask per mascherare e non disable per disattivare ?

:ciao: Ciao
ACER Extensa 5230E 2,2 Ghz cpu Celeron 900 hdd 160 GB Ram 1 GB scheda video Intel GM500
ACER Extensa 5635Z 2,2 Ghz cpu Celeron T3100 hdd 320 GB Ram 4 GB scheda video Intel Mobile 4
Quando una Finestra chiusa incontra un Pinguino la Finestra chiusa è una Finestra aperta.
Avatar utente
GjMan78
Rampante Reduce
Rampante Reduce
Messaggi: 5884
Iscrizione: mercoledì 22 novembre 2006, 19:15
Desktop: KdePlasma
Distribuzione: EndeavourOS
Sesso: Maschile
Località: ~/Italia/Lazio/Viterbo/

Re: [Risolto] Systemd: cancellare unit .device

Messaggio da GjMan78 »

Curiosità legittima.

Ecco perché non ho usato disable

Codice: Seleziona tutto

sudo systemctl disable 'dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device'
Failed to disable unit: Unit file dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device does not exist.
Con mask invece

Codice: Seleziona tutto

sudo systemctl mask 'dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device'
Created symlink /etc/systemd/system/dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device → /dev/null.
Sinceramente mi piacerebbe capire il perché di tutto questo...
MacBook Pro - Intel i5-3210 - 16 Gbyte Ram DDR3 - SSD 500 Gbyte x 2
»»» 𝗙𝗮𝗶 𝗶𝗹 𝗕𝗮𝗰𝗸𝘂𝗽! ¯\_(ツ)_/¯
Avatar utente
wilecoyote
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 15720
Iscrizione: giovedì 20 agosto 2009, 16:21
Desktop: Kubuntu et alii
Distribuzione: 9.04 32bit 14/18/20/22.04 LTS 64bit
Sesso: Maschile
Località: Ceranesi - Ge

Re: [Risolto] Systemd: cancellare unit .device

Messaggio da wilecoyote »

:) Salve, questa poi, il servizio non esiste per disattivarlo, ma esiste per mascherarlo.

A meno che abbisogni disattivare /etc/systemd/system/dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243, ma è una cosa che non ho mai visto.

:ciao: Ciao
Ultima modifica di wilecoyote il lunedì 4 settembre 2023, 23:15, modificato 1 volta in totale.
ACER Extensa 5230E 2,2 Ghz cpu Celeron 900 hdd 160 GB Ram 1 GB scheda video Intel GM500
ACER Extensa 5635Z 2,2 Ghz cpu Celeron T3100 hdd 320 GB Ram 4 GB scheda video Intel Mobile 4
Quando una Finestra chiusa incontra un Pinguino la Finestra chiusa è una Finestra aperta.
Avatar utente
GjMan78
Rampante Reduce
Rampante Reduce
Messaggi: 5884
Iscrizione: mercoledì 22 novembre 2006, 19:15
Desktop: KdePlasma
Distribuzione: EndeavourOS
Sesso: Maschile
Località: ~/Italia/Lazio/Viterbo/

Re: [Risolto] Systemd: cancellare unit .device

Messaggio da GjMan78 »

In realtà avevo già controllato per vedere se esistessero altri "pezzi" correlati ma non ho trovato nulla.

Codice: Seleziona tutto

ls /etc/systemd/system/
 btrfs-balance.timer.d
 btrfs-scrub.timer.d
 getty.target.wants
 graphical.target.wants
 local-fs.target.wants
 multi-user.target.wants
 network-online.target.wants
 printer.target.wants
 sockets.target.wants
 sysinit.target.wants
 timers.target.wants
 user@.service.wants
 dbus-org.fedoraproject.FirewallD1.service
 dbus-org.freedesktop.Avahi.service
 dbus-org.freedesktop.nm-dispatcher.service
 dbus-org.freedesktop.timesync1.service
 default.target
 dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device
 display-manager.service
 paccache.service
 paccache.timer
 powertop.service
 systemd-rfkill.service
 systemd-rfkill.socket

Codice: Seleziona tutto

lt /etc/systemd/system/
 /etc/systemd/system
├──  btrfs-balance.timer.d
│  └──  schedule.conf
├──  btrfs-scrub.timer.d
│  └──  schedule.conf
├──  getty.target.wants
│  └──  getty@tty1.service -> /usr/lib/systemd/system/getty@.service
├──  graphical.target.wants
│  └──  power-profiles-daemon.service -> /usr/lib/systemd/system/power-profiles-daemon.service                                              
├──  local-fs.target.wants
│  └──  ananicy-cpp.service -> /usr/lib/systemd/system/ananicy-cpp.service
├──  multi-user.target.wants
│  ├──  avahi-daemon.service -> /usr/lib/systemd/system/avahi-daemon.service
│  ├──  cups.path -> /usr/lib/systemd/system/cups.path
│  ├──  cups.service -> /usr/lib/systemd/system/cups.service
│  ├──  firewalld.service -> /usr/lib/systemd/system/firewalld.service
│  ├──  irqbalance.service -> /usr/lib/systemd/system/irqbalance.service
│  ├──  libvirtd.service -> /usr/lib/systemd/system/libvirtd.service
│  ├──  lm_sensors.service -> /usr/lib/systemd/system/lm_sensors.service
│  ├──  memavaild.service -> /usr/lib/systemd/system/memavaild.service
│  ├──  NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
│  ├──  nohang.service -> /usr/lib/systemd/system/nohang.service
│  ├──  powertop.service -> /etc/systemd/system/powertop.service
│  ├──  preload.service -> /usr/lib/systemd/system/preload.service
│  ├──  prelockd.service -> /usr/lib/systemd/system/prelockd.service
│  ├──  remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
│  ├──  tlp.service -> /usr/lib/systemd/system/tlp.service
│  └──  waydroid-container.service -> /usr/lib/systemd/system/waydroid-container.service
├──  network-online.target.wants
│  └──  NetworkManager-wait-online.service -> /usr/lib/systemd/system/NetworkManager-wait-online.service
├──  printer.target.wants
│  └──  cups.service -> /usr/lib/systemd/system/cups.service
├──  sockets.target.wants
│  ├──  avahi-daemon.socket -> /usr/lib/systemd/system/avahi-daemon.socket
│  ├──  cups.socket -> /usr/lib/systemd/system/cups.socket
│  ├──  libvirtd-ro.socket -> /usr/lib/systemd/system/libvirtd-ro.socket
│  ├──  libvirtd.socket -> /usr/lib/systemd/system/libvirtd.socket
│  ├──  virtlockd.socket -> /usr/lib/systemd/system/virtlockd.socket
│  └──  virtlogd.socket -> /usr/lib/systemd/system/virtlogd.socket
├──  sysinit.target.wants
│  ├──  mbpfan.service -> /usr/lib/systemd/system/mbpfan.service
│  └──  systemd-timesyncd.service -> /usr/lib/systemd/system/systemd-timesyncd.service
├──  timers.target.wants
│  ├──  btrfs-balance.timer -> /usr/lib/systemd/system/btrfs-balance.timer
│  ├──  btrfs-scrub.timer -> /usr/lib/systemd/system/btrfs-scrub.timer
│  ├──  fstrim.timer -> /usr/lib/systemd/system/fstrim.timer
│  ├──  paccache.timer -> /etc/systemd/system/paccache.timer
│  └──  snapper-cleanup.timer -> /usr/lib/systemd/system/snapper-cleanup.timer
├──  user@.service.wants
│  └──  uresourced.service -> /usr/lib/systemd/system/uresourced.service
├──  dbus-org.fedoraproject.FirewallD1.service -> /usr/lib/systemd/system/firewalld.service
├──  dbus-org.freedesktop.Avahi.service -> /usr/lib/systemd/system/avahi-daemon.service
├──  dbus-org.freedesktop.nm-dispatcher.service -> /usr/lib/systemd/system/NetworkManager-dispatcher.service
├──  dbus-org.freedesktop.timesync1.service -> /usr/lib/systemd/system/systemd-timesyncd.service
├──  default.target -> /usr/lib/systemd/system/graphical.target
├──  dev-disk-by\x2duuid-b7e0858a\x2d5114\x2d45d2\x2da976\x2d7af690655243.device -> /dev/null
├──  display-manager.service -> /usr/lib/systemd/system/sddm.service
├──  paccache.service
├──  paccache.timer
├──  powertop.service
├──  systemd-rfkill.service -> /dev/null
└──  systemd-rfkill.socket -> /dev/null
MacBook Pro - Intel i5-3210 - 16 Gbyte Ram DDR3 - SSD 500 Gbyte x 2
»»» 𝗙𝗮𝗶 𝗶𝗹 𝗕𝗮𝗰𝗸𝘂𝗽! ¯\_(ツ)_/¯
Avatar utente
wilecoyote
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 15720
Iscrizione: giovedì 20 agosto 2009, 16:21
Desktop: Kubuntu et alii
Distribuzione: 9.04 32bit 14/18/20/22.04 LTS 64bit
Sesso: Maschile
Località: Ceranesi - Ge

Re: [Risolto] Systemd: cancellare unit .device

Messaggio da wilecoyote »

:) Salve, forse ho trovato la spiegazione in questo post immagini divertenti.

:ciao: Ciao
ACER Extensa 5230E 2,2 Ghz cpu Celeron 900 hdd 160 GB Ram 1 GB scheda video Intel GM500
ACER Extensa 5635Z 2,2 Ghz cpu Celeron T3100 hdd 320 GB Ram 4 GB scheda video Intel Mobile 4
Quando una Finestra chiusa incontra un Pinguino la Finestra chiusa è una Finestra aperta.
Avatar utente
GjMan78
Rampante Reduce
Rampante Reduce
Messaggi: 5884
Iscrizione: mercoledì 22 novembre 2006, 19:15
Desktop: KdePlasma
Distribuzione: EndeavourOS
Sesso: Maschile
Località: ~/Italia/Lazio/Viterbo/

Re: [Risolto] Systemd: cancellare unit .device

Messaggio da GjMan78 »

wilecoyote ha scritto:
lunedì 4 settembre 2023, 23:26
:) Salve, forse ho trovato la spiegazione in questo post immagini divertenti.

:ciao: Ciao
:rotfl:

And who you gonna call??

Immagine
MacBook Pro - Intel i5-3210 - 16 Gbyte Ram DDR3 - SSD 500 Gbyte x 2
»»» 𝗙𝗮𝗶 𝗶𝗹 𝗕𝗮𝗰𝗸𝘂𝗽! ¯\_(ツ)_/¯
Scrivi risposta

Ritorna a “Altre distribuzioni e sistemi operativi”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 1 ospite