Untarring a fresh OS image

From PrgmrWiki
Revision as of 20:26, 15 May 2009 by Cory Myers (talk | contribs) (Created, following ticket #679.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

We'll use Debian for this example; this page details how to avoid Begin: Waiting for root file system ... errors.

Boot CentOS rescue (2.6.18-92.el5xen) from GRUB.

Log in as root.

Reformat your filesystem:

# mkfs.ext3 /dev/xvda1

The usual warnings about destroying all your data, etc., apply; presumably you know what you're doing.

Mount your disk (-n prevents errors about /etc/mtab being read-only):

# mount -n /dev/xvda1 /mnt

Find the image you want in /distros:

# ls /distros
centos64.tar.gz  debian64.tar.gz  lost+found  netbsd64.tar.gz  ubuntu64.tar.gz

Now, untar it:

# cd /mnt
# tar xzf /distros/debian64.tar.gz

Set your new root password:

# chroot /mnt
# passwd
# exit

Finally, fix the GRUB menu. Open /mnt/boot/grub/menu.lst and replace LABEL=PRGMRDISK1 with /dev/xvda1. You'll end up with:

default=0
timeout=5

title Debian lenny
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-1-xen-amd64 root=/dev/xvda1 ro
initrd /boot/initrd.img-2.6.26-1-xen-amd64

title Debian lenny single user
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-1-xen-amd64 root=/dev/xvda1 ro single
initrd /boot/initrd.img-2.6.26-1-xen-amd64

Clean up and get out:

# cd
# umount -n /mnt
# shutdown -h now

Reboot into your new install; you should be all set.