Bash/UNIX

Making a ‘Restore Disk’ for the Acer Aspire One

Acer Aspire One

We just picked up a little Acer Aspire One netbook. We’re pretty happy with it so far (except we’ll be exchanging it for a new one since the ‘p’ key on this one only works half the time). I’ll probably do a more in depth review once we’ve used it a bit but it certainly is tiny and handy. The only major drawback is the tiny mousepad. Anyway, it doesn’t come with a system restore or Windows disk. I realize there’s a hidden partition on the hard drive but I don’t really like trusting a single hard drive. Google didn’t turn up any really handy answers for how to make a system restore disk from a hidden partition or an entire install (especially onto a USB hard drive) using free software so I thought I’d document what I ended up coming with. I have no idea if this is the smartest/safest way to do this and I’d recommend getting Norton Ghost or something similar if you don’t feel confident with any of the processes in here.

There’s two steps to the process, making a USB drive into a little bootable linux system and backing up the partitions onto a USB hard drive.

Things You’ll Need

  • Some annoying computer with no backup/restore CD
  • USB Key Disk
  • USB Harddrive

I think you could actually just do this with a single harddrive or a really big USB key if you made it into 2 partitions (the SystemRescueCD OS doesn’t save changes by default).

Making a bootable linux USB disk

I used SystemRescueCD for my linux system (although I suppose any small distribution with the appropriate tools would work). Obviously a CD does not do a lot of good when you have a laptop without a CD player but luckily (the somewhat misnamed) SystemRescueCD can be installed to a USB drive. As documented on that page, you’ll need to download the .iso from the SystemRescueCD site and move most of the files from the .iso to your USB drive. If you don’t already have a handy way to mount an .iso and don’t feel like burning a CD, I had decent luck with Microsoft Virtual CD-ROM Control Panel or if you’re using Linux just a simple mount -o loop disk.iso /some/empty/folder (although for some strange reason I had trouble getting a Linux-made version working). Once you’ve copied the files from the CD and ran syslinux as directed, you should have a handy USB key that will boot a computer into linux (if you set the BIOS to boot from USB).

Backing Up Partitions

Once you’ve got your little USB linux, you’ll want to look at Lifehacker’s handy walkthrough to SystemRescueCD. Replace all mentions of CD with USB disk and instead of backing up to the same hard drive, we’ll back up to an additional USB hard drive.

Now from here on out, you’ll want to be very careful. Things should be (mostly) safe but messing around with partitions is getting towards the more touchy end of computing. I’d back up anything important to a separate harddrive. After that, here we go:

  1. Turn off your computer, stick in your USB key drive (not the USB hard drive yet) and press <F12> on startup to set the BIOS to boot from the USB
  2. The SystemRescueCD OS should come up. Hit return at boot: and pick the appropriate keyboard type if it asks.
  3. Once the root@sysresccd /root % prompt comes up, run partimage. Look through the list of partitions. You should see an approximately 5 GiB partition (the hidden restore partition), the big main partition about the size of your harddrive and a small partition about the size of your USB disk. Write down which is which. On my Acer Aspire One, the hidden partition shows up as fat32 on sda1, the main windows partition as ntfs on sda2 and my USB disk plugged in the left USB port as sdb1. Exit partimage by pressing <F6>.
  4. Plugin in your USB harddrive. Wait a couple seconds. Start partimage again and you should see a new partition appear that’s the size of your USB harddrive. Write it down. On the AAO, the close right USB port comes up as sdc1. Also note if the harddrive is ntfs. Exit again with <F6>.
  5. Move to the mnt directory (cd /mnt). Make a new directory named myusb (mkdir myusb). Now mount the USB harddrive (connect it to the folder we just made). If your harddrive is ntfs then do ntfs-3g /dev/[insert USB harddrive partition] /mnt/myusb, otherwise type mount /dev/[your USB harddrive's partition goes here] /mnt/myusb. In my case, this was mount /dev/sdc1 /mnt/myusb.
  6. Make a directory somewhere convenient on the backup harddrive (in /mnt/myusb). I did mkdir /mnt/myusb/backup. Write down the full path for this directory.
  7. Start partimage (last time this time). Select either the main Windows partition or the hidden partition you want to backup, press <Right>, enter /mnt/myusb/backup/partbak in the “Image file to create/use” box. Hit <F5> to go to the next screen and <F5> again to accept the default options (gzip the image files and split into 2 Gb files). Enter a descriptive description and hit Return (twice) to go to the next screen. Take a quick glance at the information and hit <Right> and Return again to start the backing up.
  8. Get a coffee or two and wait until it finishes. Exit. Shutdown the computer. Remove the USB drives. Restart in Windows, plug in the USB harddrive and make sure the drives contains a backup folder with partbak.000รฏยผล’partbak.001… inside. If so, congratulations.

Geez that ended up going longer than I thought but that should be it. Now if worse comes to worse, you can do the reverse to restore (hopefully). I’ve only tried restoring once but it’s one for one so far.

Bash/UNIX
Programmer

Comments (22)

Permalink

Using quotation marks effectively in Unix

This is pretty basic knowledge but I’ve helped a few people out recently that had been using Unix/Linux for a while and didn’t know and it sure helped me out when I figured it out. If you had asked me how many quotation marks were on a keyboard before I started doing Bash stuff I would have said two. But I, and it seems most non-programmers, often forget the little ` on the same key as the tilde ~ (to the left of the numbers on standard keyboards). So there are actually three types of quotation marks and each one means something different to Unix:

Continue Reading »

Bash/UNIX
Programmer

Comments (7)

Permalink

Reading Standard Input in a Bash Shell Script

I guess this is obvious to most people but it took me quite a while to dig it out on the internet. I wanted my bash script to be able to read from standard input like cat sourcefile.txt|bash myscript.bash. It turns out the standard input can be read from /dev/stdin. So if I wanted to sort the standard input, myscript.bash would look like: sort /dev/stdin

I think this is probably basic UNIX knowledge but I’m not a programmer.

Bash/UNIX
Programmer

Comments (6)

Permalink