Skip to content

Instantly share code, notes, and snippets.

@darccio
Created August 15, 2017 14:53
Show Gist options
  • Save darccio/b4eb41a350c82cd9adcb79e498ec3428 to your computer and use it in GitHub Desktop.
Save darccio/b4eb41a350c82cd9adcb79e498ec3428 to your computer and use it in GitHub Desktop.
Post-provision initial setup for Scaleway's Debian Stretch image
[Unit]
Description=Mount Data Volume at boot
[Mount]
What=UUID="$(blkid)"
Where=/mnt/data
Type=ext4
Options=defaults
[Install]
WantedBy=local-fs.target

This gist enumerates some extra steps to solve some quirks of Scaleway's Debian Stretch image and how to mount your additional volume.

These steps avoid journal logs pollution and startup hanging (until they timeout) trying to mount:

systemctl stop getty@ttyAMA0
systemctl stop getty@ttyS1
systemctl stop serial-getty@ttys0
systemctl disable getty@ttyAMA0
systemctl disable getty@ttyS1
systemctl disable serial-getty@ttys0
vi /etc/rsyslog.d/50-default.conf      # Comment all related lines to /dev/xconsole.
timedatectl set-timezone $tz           # Where $tz is your selected timezone from $(timedatectl list-timezones).
vi /lib/systemd/system/haveged.service # Add systemd-tmpfiles-setup.service to After= list.
mkdir -p /mnt/data
mkfs.ext4 /dev/vdb
vi /etc/systemd/system/mnt-data.mount  # Create it with content below, using blkid for getting /dev/vdb's UUID.
                                       # You can create additional mount points. Just make sure you create an
                                       # unique mount for each, with their names matching their paths.
systemctl daemon-reload
systemctl start mnt-data.mount
systemctl enable mnt-data.mount
reboot

Systemd is really weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment