Snott

Category: Linux

Linux Related stuff, system administration, installation tutorials and more

  • Recovering from a totally dead boot partition

    Recovering from a totally dead boot partition

    Here is the case:

    The hard disk containing your /boot partition has just died, you have a separate RAID1 array (using mdadm) with all the information on the array intact, but the system is unable to boot because all the files in /boot got lost.

    Your best bet is to get the following iso onto a USB flash drive or CD:

    http://sourceforge.net/p/ubuntu-secured/home/Home/

    Ubuntu secure remix provides the following functionalities:

    • Full Ubuntu DVD distro
    • integrates Clean-Ubiquity: automatic backup of the MBRs and partition tables when installing Ubuntu, which is highly recommended for dual-boot Ubuntu-Windows (or MacOS)
    • integrates OS-Uninstaller (tool to uninstall any Operating System from your PC)
    • integrates Boot-Repair (tool to fix the PC boot)

    the one highlighted in bold is what we are going to use to fix the boot partition.

    With the ubuntu DVD and Boot-repair you will be able replace the missing kernels and initrds, reinstall any broken packages and get grub again onto the MBR, successfully restoring the computer or server to a bootable state.

    Now, burn your iso to cd (I assume you know how to do this) or get into an USB drive like this:

    dd if=/path/to/file.iso of=/dev/sdb

    where /dev/sdb is your USB drive, you can use the mount command to double check this. If you make a mistake here (for example if you input /dev/sda and /dev/sda is your laptop hard drive) you will end up writing the iso to your hard drive and DESTROY all of your data. So please double-check this.

    After you boot into the Ubuntu Secure Remix, first thing to do is chroot and then create a /boot directory (since the old one is lost). Chroot is a command that will mount the operating system stored on the hard drive so you are able to execute commands inside it. This is a very important step. To do this:

    # means run with root or sudo
    1. Create a mountpoint

    # mkdir /mnt/mountpoint

    2. Mount /dev and /dev/pts to chroot

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

    # mount -o bind /dev/pts /mnt/mountpoint/dev/pts

    3.Open bash in chroot

    # chroot /mnt/mountpoint /bin/bash

    4. create the /boot directory

    #mkdir /boot

    At this point, you are now inside your unbootable linux system with and empty /boot directory, now do:

    sudo apt-get install linux-image-server

    That command (on a debian/ubuntu based system) will pull the latest kernel image and install it, populating the /boot directory with some files (which are the kernel and initrd images). If you have a different distro do the same with your distro’s package manager.

    Next open up Boot-repair from the GUI and follow the onscreen instructions to restore grub into the mbr. I won’t post them here because:

    a) it varies from system to system and depends on how screwed the OS got

    b) On screen instructions are easy to understand and get the job done

    After Boot-repair finishes, exit your chrooted terminal (by typing exit at the terminal) and restart your system.

    Everything should be in order now and the machine should boot without a problem. If it does not, feel free to leave a comment below and I will do my best to help you.

    NOTE: This procedure was tested under a Software RAID using mdadm on Ubuntu Server 10.04.4 LTS, I haven’t tested this with any other RAID array configuration or distro, be it fake, firmware or hardware RAID.

  • Ubuntu Quantal Quetzal will include amazon search results

    Ubuntu Quantal Quetzal will include amazon search results

    In a move that has proved to be controversial among Linux fans, Canonical, the parent company of Ubuntu, has decided to include Amazon search results in the release of the Ubuntu 12.10 Unity Dash search function. The reason why many people do not like this development, is that they think it means Ubuntu is now adware. However, the founder of the company, Mark Shuttleworth, has responded to these complaints by explaining why this is actually not the case.

    While Amazon will indeed be included in Ubuntu 12.10, it will be one of many other additions as well and is not meant to be an annoyance. People who use Ubuntu, when doing their work, playing http://www.foxybingo.com/ or writing e-mails to family, will want to make sure that this does not mean there will be Amazon adverts everywhere. In fact, what will happen is that when you use Unity Dash in Ubuntu 12.10 for a search, the usual search results will still come up. However, there will also be a More Suggestions results box, containing no ads but instead search results from Amazon.

    According to the Director of Technology at Canonical, Olli Ries, this extra category is meant to help users access content that is “available online in addition to what already resides on their device.” This means that users will have more options in the content that they see and the products that they can easily come into contact with. As well as Amazon being integrated into Ubuntu search, there is also an Amazon search app that is separate to this. Many more website apps will also be available, including Reddit, Facebook and BBC News. Canonical is basically doing this in order to make money, which will enable it to continue expanding Ubuntu and investing in its future success.

    I don’t consider this to be adware as long as its possible to turn it off.  If not, then this will be not only annoying but will in fact hurt the openness Linux is known for.