0

I'm trying to customize a preinstalled Ubuntu image for VM instances. My idea was to add a secondary filesystem to /etc/fstab (let's call it /config) and then symlink all relevant config files to that filesystem.

This approach works fine for /etc/network/interfaces but fails for /etc/hostname. Apparently the hostname is set before /etc/fstab is mounted, causing the symlink to fail.

How can I have /config mounted before the hostname is set? Or is there an alternative solution to this problem that does not require an early mount?

main--
  • 101
  • Just out of curiosity ... what do you want to gain by adding the secondary filesystem? – Gerald Schneider Sep 20 '18 at 13:49
  • @GeraldSchneider The root filesystem is ext4 (obviously) while the secondary fs is fat32. The point is that there are plenty of libraries and tools to easily edit a fat32 image (without mounting it) which is much harder for ext4. – main-- Sep 20 '18 at 14:02

0 Answers0