Categories
Command Line HowTo Linux Posts Ubuntu

HowTo: Mount USB Persistent casper-rw File in Linux

So, you’ve created an awesome Live USB Linux stick with a persistence file which let’s you boot anywhere and carry all your sweet sweet datas around on it too. If you want to see those files in Linux on your desktop or laptop outside the USB you’re going to have to mount the loop device (the casper-rw file) somewhere first. The following commands show how to make a folder and mount the loop and then unmount it too.

Just change the /media/USB/ for the mounted location of your mounted USB stick which contains the casper-rw file you want to view the contents of and the /home/alex/caspermnt/ for the mount point on your system.

Mount:

 mkdir ~/caspermnt
sudo mount -o loop /media/USB/casper-rw /home/alex/caspermnt/

Unmount:

 sudo umount ~/caspermnt/

This can be useful for recovering data from a borked Live USB stick or for backing up your files on your computer just to be sure.

Categories
HowTo Posts Ubuntu

Howto: Reinstall Grub using Ubuntu Live CD

I recently installed Fedora 12 on my desktop alongside Ubuntu Karmic and Windows 7, however doing so I overwrite my grub which meant my Ubuntu system was hidden. To fix this is pretty simple..

Insert your Ubuntu Live CD
Click “Try Ubuntu without any changes to your computer”
Once loaded click Applications > Accessories > Terminal

sudo fdisk -l 

#That’s a lower case L
This displays all partitions on your system, in my case the installation of my Ubuntu system was /dev/sda5 so replace this for yours in the rest of the code.

sudo mount /dev/sda5 /mnt
sudo grub-install --root-directory=/mnt/ /dev/sda

#thats a double dash before root-directory, wordpress keeps changing it to a long dash, Ill fix it sometime..
If all goes successfully you should be done, try rebooting and see if your Ubuntu shows up.

Thanks to Whiblog in the comments this also works in Ubuntu 11.04:

“same thing except the last line : sudo grub-install –boot-directory=/mnt/ /dev/sda”