Ubuntu – How to access the home folder in a live usb directly

12.04backuplive-usb

I have just finished installing Ubuntu 12.04 from an 'updated' live usb. By updated I mean I had installed other softwares, removed others, run updates and upgrades, etc.

To my surprise, the newly installed system didn't come with the updates. For example, I purged libre office and installed abiword in the live session and on installing I found Libre Office. Can someone please explain to me how that worked out.

My home folder question (according to the title) is I wanted to copy my entire live usb home folder to the installed home folder including all the .folders and configurations. I just plugged in the usb directly into the newly installed 12.04 and expecting to see all the usual 'bin, boot, etc, var, lib, sys' folders, I found 'boot, capser, dists, install, pool' folders. I tried searching for my 'live session' home folder with no success. How can I access those files without booting again into the live session mode?

Best Answer

When you're running from a live CD / USB, if you enabled persistent mode when creating the drive, the modifications you make are stored in an "overlay" filesystem, which in turn is usually stored in a file called casper-rw on the memory stick.

You can easily access it by "loop mounting" the file, which means to treat an ordinary file like a block device and access the filesystem stored in it. If your USB stick gets mounted as, e.g. /media/USB, then the following should work:

sudo mount /media/USB/casper-rw /mnt -o loop

Then the contents of the overlay, including /home/xxx, should appear under /mnt. Note that you might have permission / ownership problems, if so try accessing /mnt as root (from the command line, after sudo -s).

Related Question