Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe

    Use an ISO as if it were a real CD

    There are a few occasions when you may need or want to use an ISO image without actually burning it. You may want to grab a file off of a CD, or maybe you’re storing an image of a disk for use in Wine. Using mount points, this is an easy task.

    The Quick Way

    On a recent GNOME desktop, opening or mounting ISO images (and other archives) is very simple. Simply right-click the image, and select Open With > Archive Mounter. Done! The image will show as a drive in Places or on your desktop.

    This is the easiest way to grab a file from an image or an archive without having to open an archive manager or extract everything. But, it has its limitations. Because it is mounted under GVFS, it is typically only available on a GNOME desktop. Wine may also have trouble understanding where the image was mounted to as well, and reconfiguring Wine every time you want to change discs is no fun.

    The More Reliable Way

    Almost as quickly as the previous solution, you can mount the image in a terminal:

    sudo mount -o loop /path/to/image.iso /media/cdrom

    We’re using the CD drive location here to keep things simple: GNOME and Wine will both think that it is just a normal CD or DVD. The location of your CD drive on your filesystem may differ; check your distribution documentation for details. The -o loop option is needed because image.iso is not a block device, as the mount command would expect, but a file.

    To remove the mount point again, point the umount command at the location of the CD drive:

    sudo umount /media/cdrom

    Bonus: The Graphical More Reliable Way

    If you find yourself swapping disk images out frequently, you may find Gmountiso useful. You can easily swap out multiple images and mount points, and it works in the same manner as the mount/umount commands do.


    Restoring an Overwritten GRUB Boot Loader

    I like to have lots of choice about which operating system I can boot to. Between my desktop PC’s two hard drives, I have at least three distributions of Linux and several versions of Windows, so I have complete OS flexibility.

    Unfortunately, maintaining a multi-boot configuration like this can be a pain, especially if you later install an operating system which overwrites the GRUB boot loader you had in place (such as a version of Windows). If your boot loader is overwritten, you could be left with no choice but to boot the most recently installed OS.

    In this tutorial, I will show you how to restore an overwritten copy of the GRUB boot loader by using a Linux live CD. In this example, my master GRUB installation is on a Kubuntu 8.10 installation, and I’m using an older Kubuntu 8.04 Live CD I have lying around.

    This tutorial does require you to have some understanding of how your multi-boot system operates, disk partitions and using the command line. If you are not confident, perhaps find a friend who knows Linux more intimately to do this process.

    Before Starting

    It’s worth mentioning that you may need to use a live CD somewhat similar to that of your ‘master’ OS, where your boot loader configuration is stored. This is due to the technique we use to re-run the GRUB installer.

    Also, you need to actually know which system holds the configuration file for your GRUB boot loader and on which partition it is located. If you have a more complicated multi-boot setup, like myself, you probably know this. If you have a more simple Windows-Linux dual boot, there should only be one Linux data partition where it could be.

    Boot the Live CD

    Start the Live CD up as normal. Don’t choose to install the OS if prompted, you want to come to a full live desktop to run the specific commands we need.

    Identify your Partitions

    You need to know on which partition the GRUB config file and associated programs are stored. You may wish to use a graphical program such as Gparted (if available). You’ll want to find out the device string (such as sda5) of the relevant partition.

    GParted screenshot

    (The screenshot above is actually from my triple-boot MacBook, but still shows you how you can identify the (ext3) partition of Ubuntu on that system.)

    If you can’t use a graphical program to work this out, open a Terminal program and use the following command:

    $ sudo fdisk -l

    This will list all of the partitions on all the devices on your system. Under the ‘System’ column, you can see all of the partitions labelled as ‘Linux’. This won’t show you the difference between data and OS partitions, so is less useful in a more complex partition layout.

    Fdisk -l screenshot

    If you can work out where your Linux is from this, note down the information under ‘Device’.

    Mount the Partition

    We now must mount your partition, so that we can access it. Some Live CDs may do this for you, or offer to do so, but here we will perform the process manually.

    We will first make a folder in which the partition is mounted and then do the mounting. Replace the device string /dev/sda5 with the device string that you identified earlier.

    $ sudo mkdir /mnt/system
    $ sudo mount /dev/sda5 /mnt/system

    You should now be able to browse your hard drive by navigating to that folder. The next process we are going to perform is to temporarily change the root directory of our terminal (chroot), so that we can run the GRUB installer directly from the hard drive. It won’t even realise it’s not running from the real system

    On Ubuntu and other sudo-based distros, we must first do this:

    $ sudo -i

    to become root fully (sudo is not enough here).

    Doing the chroot

    The GRUB installer requires to read the devices on disk directly in order to write the GRUB boot record back onto the system properly. It therefore needs a working copy of /dev, inside the mounted directory.

    # mount -o bind /dev /mnt/system/dev

    Next, we can run chroot:

    # chroot /mnt/system

    From this point forward, be very careful. You have root privileges and full write access to your hard drive. The usual caveats apply.

    Run the GRUB Installer

    All we need to do now is to simply run the GRUB installer, which plonks the GRUB boot record back on the hard disk and gives us back all of our choices.

    # grub-install /dev/sda

    If you need to install GRUB elsewhere (such as a different disk or a specific partition), change /dev/sda. In most cases, just leave this as-is.

    GRUB splash

    GRUB should be re-instated on disk. You can now simply close your terminal, reboot the machine safely and everything should be back to normal.


    Quick Tip: Clear Out GNOME Tracker Indexes

    Tracker logo

    If you followed my recent video tutorial on enabling Ubuntu/GNOME’s Tracker search tool, you should now be enjoying the ability to search the files on your system.

    During a recent upgrade to Ubuntu 9.04, which was recently released, I found that the Tracker search tool index had become corrupted. I tried to tell Tracker to rebuild the index, but experienced some weird issues.

    In this quick tip, I’ll show you how to avoid this and other issues by deleting Tracker’s index and cache manually, so that it can start ‘from scratch’. Note that if you are having issues with tracker, it is worth trying to rebuild the index from the graphical interface first. This tip is a last resort if you need to clear everything out from scratch and start it again.

    Tracker’s Files

    According to the documentation, Tracker stores its files in the following locations:

    • Configuration Files – ~/.config/tracker/tracker.cfg
    • Data Files – ~/.local/share/tracker
    • Index Cache – ~/.cache/tracker

    If you’re happy with the settings you have, you may want to leave the configuration file intact, and just wipe out the data files and index cache.

    Quit Tracker and Delete the Files

    First of all, you need to go ahead and quit the Tracker application in the system tray.

    Quit the Tracker tray applet

    Next, you must quit all processes of both trackerd and tracker-indexer, so open up a terminal and run these commands:

    $ killall trackerd
    $ killall tracker-indexer

    And finally, carefully delete the files listed above (excluding the config file, if you don’t think you need to clear that out as well).

    So to recap, go ahead and delete the folders:

    • ~/.local/share/tracker
    • ~/.cache/tracker

    and if you wish, the config files:

    • ~/.config/tracker/tracker.cfg
    • ~/.config/tracker/tracker-applet.cfg

    To restart Tracker, I recommend that you log out and log back in so that trackerd and the system tray applet both restart properly. You should then be able to reconfigure it from the beginning as detailed in the original tutorial.

    And that should be it – Tracker should rebuild itself from scratch. Useful to know for if things go wrong!


    1. 1
    2. 2
    3. 3
    4. 4
    5. ...
    6. Go to