Make it persistent

This page describes the following steps:

3. Resize fat32 boot partition
4. Add ext4 “casper-rw” partition
5. Add Ubuntu persistent to boot menu


– Something that runs Ubuntu (or another operating system that runs Gparted)
– The Ubuntu drive we made in the previous page (of course..)

3. Resize fat32 boot partition

For this step you need Ubuntu (or any other operating system that can run Gparted). Applications like Disk Utility (the OSX partition manager) doesn’t seem to be able to resize partitions and/or create ext4 file systems. And you can’t use the bootable Ubuntu drive we just created, because we have to unmount the boot partition to resize it – which is not possible.

The fat32 boot partition only has to be about 1GB in size. Since Rufus turns your drive into one big partition, we are going to resize this (also; we need space for the “casper-rw” partition we create in the next step)

Why 1GB although currently only 750MB is used?
I do not recommend this; but when you upgrade to another Ubuntu version (e.g. from 12.04 to 12.10) or update the kernel, the upgrade-application writes files to the boot partition. For this reason I like it to be at least 1GB – just to be sure.

First, we need Gparted. The easiest way is to use the Ubuntu Software Center:


Now we will resize the fat32 boot partition…

– Startup Gparted
– Select your Ubuntu drive from the drop-down-menu in the right-upper-corner
– Right click on the drive and select “unmount”
– Right click again and select “resize”
– Set size to something like 1000MB


Probably there’s a masochistic way to do all of this with the terminal. But if you like doing things the hard way, I will make this even more pleasant for you by not helping you in any way possible.

4. Add ext4 “casper-rw” partition

This part you can do when booted from your new external Ubuntu drive!

In persistent mode the partition labeled “casper-rw” is by default used to save any changes:

– changes/updates made to the operating system
– installed software/applications
– and anything saved in the home folder (Documents, Downloads, Desktop, etc.)

So we need to add an casper-rw partition..

– Open Gparted again (if it isn’t still running)
– Select your Ubuntu drive in the right-upper-corner
– Right click on the (grey) unallocted space and select “New”
– Set the size of the partition to what you desire (probably at least 2GB)
– Set the File system to ext4 (ext4 is best because of read/write cycles)
– Label it “casper-rw” (exactly this name)


5. Add Ubuntu persistent to boot menu

The Ubuntu USB stick uses two boot menu’s; Grub and Syslinux. Therefor you have to change two files:


if loadfont /boot/grub/font.pf2 ; then
    set gfxmode=auto
    insmod efi_gop
    insmod efi_uga
    insmod gfxterm
    terminal_output gfxterm

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Ubuntu persistent" {
    set gfxpayload=keep
    linux    /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper persistent quiet splash --
    initrd    /casper/initrd.lz
menuentry "Try Ubuntu without installing" {
    set gfxpayload=keep
    linux    /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
    initrd    /casper/initrd.lz
menuentry "Install Ubuntu" {
    set gfxpayload=keep
    linux    /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash --
    initrd    /casper/initrd.lz
menuentry "Check disc for defects" {
    set gfxpayload=keep
    linux    /casper/vmlinuz.efi boot=casper integrity-check quiet splash --
    initrd    /casper/initrd.lz

[the bold part is new/changed]


default persistent
label persistent
  menu label ^Ubuntu persistent
  kernel /casper/vmlinuz.efi
  append  file=/cdrom/preseed/ubuntu.seed boot=casper persistent initrd=/casper/initrd.lz quiet splash --
label live
  menu label ^Try Ubuntu without installing
  kernel /casper/vmlinuz.efi
  append  file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --
label live-install
  menu label ^Install Ubuntu
  kernel /casper/vmlinuz.efi
  append  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash --
label check
  menu label ^Check disc for defects
  kernel /casper/vmlinuz.efi
  append  boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
label memtest
  menu label Test ^memory
  kernel /install/mt86plus
label hd
  menu label ^Boot from first hard disk
  localboot 0x80

[the bold part is new/changed]

Also you need to change this to see the menu:


# D-I config version 2.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 50
# disable the next line (with #) to see the boot menu
# ui gfxboot bootlogo

[the bold part is new/changed]

Read the “Optimize“-section to learn how to boot directly to Ubuntu (skipping all the menu’s). Also read that page for the changes you need to make in case you want to update the kernel or upgrade to a new Ubuntu version (e.g. from 12.04 to 12.10).

<< Make USB drive Top Add user and encryption >>

8 thoughts on “Make it persistent

    1. @Thiago, you do realise this is for a bootable USB stick, I hope? Installing Ubuntu on a fixed hdd doesn’t require editing any editing of core files.

      Trying to run a complete Windows system from a USB stick while also storing data on said stick, now that is an altogether different matter. 😉

  1. Hi, I am new in the Linux world, I just discover this post and I see is too old, you are using Ubuntu 12.10. Could you do it please with Ubuntu 17.04? I follow this tutorial but Ubuntu do not Start. After showing grub fill my screen with letters and then say error a lot of times and finally get freeze.
    Thank you in advanced.

  2. A mi no me funciona.
    Me sale el menu con ubuntu persistent, y cuando le doy me da error de que no encuentra el archivo ‘/
    He editado el 3 archivo, los 3 tal y como hay que editarlos.

  3. If i prepare my usb with this partitioning and config files, the boot fails with the following error message:

    (initramfs) mount: mounting /cow on /root failed: Invalid argument
    overlay mount failed

    and leaves me with BusyBox prompt. Strangely, if I now cd to /cow, I can see there are four items (upper dir, work dir and format file), so the casper-rw partition in fact was mounted successfully.

    Totally stuck at this point, no idea what and how to fix.

  4. Hi, I tried “Make it persistent” with your method on my Mac. It worked. Thanks.
    For someone’s reference
    ubuntu 16.04 on MacBook Pro Mid 2009 with Buffalo 16GB USB stick

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s