How-To: Recovering from errors without restoring

Discussion in 'Linux' started by QplQyer, Nov 17, 2008.

  1. QplQyer

    QplQyer

    Joined:
    Nov 15, 2008
    Messages:
    5
    Likes Received:
    0
    After just borking the system whilst using usermod -l (apparently this is NOT safe to do unless you run gdm), I thought it might be useful to make a how-to on how you can restore your system without needing to revert to a previous backup, which might not always be available.

    The advantage of this method is that it does not require you to format a usb-stick and that you do not need to have the most recent backup.

    What you will need is:

    • A usb-stick with a large enough size to hold the slax linux distribution (~200MiB)[/*:z4bpprp4]
    • Slax version 6.0.8 RC6 (or higher, but I only tested it with this version). Note that Slax 6.0.7 refuses to start on the Acer Aspire One.
      You can download this version from http://nimue.fit.vutbr.cz/slax/testing/slax-test/ [/*:z4bpprp4]

    Creating the bootable usb-stick goes as follows:

    • Create a temporary mountpoint:
      Code:
      sudo mkdir /mnt/tmp
      [/*:z4bpprp4]
    • Mount the iso-image as a file system:
      Code:
      sudo mount -o loop -t iso 9660 slax608-rc6.iso /mnt/tmp
      [/*:z4bpprp4]
    • Copy everything from the mountpoint to your usbstick:
      Code:
      cp -R /mnt/tmp <usbstickmountpoint>
      [/*:z4bpprp4]
    • Run the slax installer:
      Code:
      cd <usbstickmountpoint>/boot
      sudo ./bootinst.sh
      [/*:z4bpprp4]

    Then, you just insert the usbstick in your AAO (acer aspire one), press F12 when you see the acer-logo, choose usbstick (second option) and wait
    until slax greets you. Then just press enter and after a while slax should be up and running in the KDE-environment. Normally slax will have mounted the harddisk of the acer aspire one on /mnt/hda1 if not, you will have to search for the correct path. After identifying the right path, you just execute the following:

    Code:
    sudo chroot /mnt/hda1
    
    After issuing this command, this terminal will behave as if it was a terminal started on the linpus system. This means you can issue commands such as yum or standard linux commands and in this way fix your system by removing corrupt packages, editing config files etc. In my case, I fixed the usermod-problem by typing

    Code:
    usermod -l user <CURRENTUSERNAME>
    
    After that, reboot and everything will be back to working order.

    I hope this will be useful to someone, it's common knowledge to anyone ever having installed gentoo (where chroot'ing is required to install gentoo), but maybe not to everyone tinkering with linpus on his AAO. As it can save a lot of time spent backing up/restoring for such little changes as the one I made, I think it's certainly a worthwhile trick to know.
     
    QplQyer, Nov 17, 2008
    #1
  2. QplQyer

    vi_jedi

    Joined:
    Dec 14, 2008
    Messages:
    1
    Likes Received:
    0
    I tried slax608-rc7. It hung on boot and never brought up a prompt. slax608-rc6 worked great for me.
     
    vi_jedi, Dec 14, 2008
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.