Ubuntu – Custom fstab + grub menu in bootable persistent USB created with mkusb


I have created a custom live CD image (erm… live USB, I suppose it'd be more accurate) through a combination of Cubic (to generate a custom .iso) and mkusb to provide it with persistency through a casper-rw partition.

It's working really well, but mkusb seems to be creating its own fstab and its own grub menu.

One of the things that mkusb does is creating a "regular" NTFS partition so the USB stick can be used as a "regular" storage stick (to save pictures, docs or whatever in it), yet that partition doesn't seem to be mounted on boot.

It would be great if it could be, because I have a pretty specific use I'd like to give to it (specifically, Docker images which now only seem to work properly if I specify devicemapper as the storage-driver). It would really, really help if I could have that NTFS partition mounted in /var/lib/docker/[storage], but even if I change /etc/fstab while in Cubic, those changes are not reflected in the image that is written to the USB stick.

Something similar happens with the Grub menu. Cubic allows to specify your own, but this seems to be overwritten by mkusb and because of issues with the computers where the stick is going to be used, it would be great if I could add a nolapic flag to the boot line.

Is there any way of doing this?

PS 01: I'm not married to mkusb… I do like how easy it is to get a persistent USB with it and that works on bios with UEFI boot, though but maybe another tool would give me more control?

PS 02: I don't know much about… anything, really but for this specific use case, let's say I don't know much about persistent partitions on bootable USB sticks.

Best Answer

  1. You can try if you can mount the NTFS partition manually with a mount command line. When that works, you can save the command line(s) to your ~/.bashrc file, that should make it mount automatically where you want it in the future. There are details about mounting NTFS at this link.

    The OP found it better to add the mount into the rc.local instead of the .bashrc

  2. You can add the boot option nolapic near the end (like persistent) in the line starting with linux for each Ubuntu menuentry that you want to use in the file grub.cfg in partition #3 of the live USB drive.