How to clear persistent storage on live Linux USB?

13,329

Yes it is possible.

If you're booting from the USB, you don't want to repartition the whole thing, you just want to recreate the loopback casper-rw partition.

I've just done it with a Karmic Koala USB stick from 2009. Current ones may work a bit differently (I've been on a bit of a holiday from Ubuntu the last year or so).

Enable expert mode and remove "persistent" from the kernel boot command line. Then it won't even try to use the casper-rw file for persistence (it will use a ramdisk overlay instead).

Say your usb stick is mounted at /cdrom (for some reason that's what I got).

You will need to do

sudo mkfs.ext3 /cdrom/casper-rw

and prompt it to proceed even though the file is not a block device.

If it complains that your USB stick is mounted read-only, use

sudo mount -o remount -o rw /cdrom

first, to make it read-write.

You can also do the mkfs command line on any other working linux system where you can mount your USB stick.

Share:
13,329

Related videos on Youtube

Flint
Author by

Flint

Updated on September 18, 2022

Comments

  • Flint
    Flint almost 2 years

    I created a live Ubuntu USB that has persistent storage using Universal USB Installer. Every time I boot the USB, I keep getting an alert message telling me that the drive is low on space. Is it not possible to clear or remove files in persistent storage?

    • Arvanitis Christos
      Arvanitis Christos almost 12 years
      What operating system are you on?