¿Cómo montar /var/log/ en una partición separada?

¿Cómo montar /var/log/ en una partición separada?

Instalé Ubuntu 18.04 en un servidor nuevo y necesito montarlo /var/logen una partición separada. Creé una nueva partición ext4y montarla manualmente funciona bien. El servidor no arranca si lo monto /var/logdurante el arranque mediante fstab.

/var/log/syslog:Nov 21 18:52:54 server kernel: [ 2126.966538] EXT4-fs (nvme2n1p1): mounted filesystem with ordered data mode. Opts: (null)
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping Session 1 of user root.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping Session 5 of user USERNAME.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping Availability of block devices...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping Session 3 of user root.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopped target Graphical Interface.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopped target Multi-User System.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping The PHP 7.2 FastCGI Process Manager...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping The Apache HTTP Server...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping The PHP 5.6 FastCGI Process Manager...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopped Wait until snapd is fully seeded.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping D-Bus System Message Bus...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping The PHP 7.1 FastCGI Process Manager...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping The PHP 7.3 FastCGI Process Manager...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping System Logging Service...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping Unattended Upgrades Shutdown...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping LSB: Record successful boot for GRUB...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping Deferred execution scheduler...
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopping LSB: set CPUFreq kernel parameters...
/var/log/syslog:Nov 21 18:53:18 server blkdeactivate[13934]: Deactivating block devices:
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopped target Timers.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopped Clean PHP session files every 30 mins.
/var/log/syslog:Nov 21 18:53:18 server systemd[1]: Stopped Message of the Day.

/var/log/unattended-upgrades/unattended-upgrades-shutdown.log:2019-11-21 18:53:18,394 WARNING - SIGTERM or SIGHUP received, stopping unattended-upgradesonly if it is running

/dev/nvme2n1p1sería la partición de destino. ¿Cuál es la forma correcta de montar una /var/logpartición separada al arrancar?

Mi fstab:

/dev/md/0 / ext4 noatime 0 1
#/dev/nvme2n1p1 /var/log ext4 noatime 0 2
/dev/md/1 /home ext4 noatime 0 2
/dev/md/2 /tmp ext4 noatime 0 2
/dev/md/3 /var/www ext4 noatime 0 2
/dev/nvme2n1p2 /var/backup ext4 noatime 0 2
proc /proc proc defaults 0 0

Respuesta1

Tuve que usar los UUID en fstab. Sin ellos, intercambiaba nvme1n1p1 con nvme2n1p1 y viceversa en cada inicio, por lo que la partición siempre estaba ocupada y no se podía montar. Nunca antes había visto un comportamiento así. Hice innumerables reinicios con los UUID y ahora funciona bien

información relacionada