After failure of hard disk on monday, managed to fix things. Although the Ubuntu box could not even see the partition table of the drive in question, I could see it if I put the drive in another PC. I decided to copy everything on this drive onto another drive and try to boot off that.
Here is approximately what I had to do:
- Fix both disks in PC. Old linux partition was /dev/hdd2, new one is /dev/hdb1
- repartition new disk into a large linux (type 0x82) partition and a smaller linux swap (0x83)
-
ran
to initialise new swap.
mkswap /dev/hdb2
-
ran
to create ext3 file system on new disk partition.
mke2fs -O journal_dev /dev/hdb1 mkfs.ext3 /dev/hdb1
-
Mounted both old and new partitions and copied everything from old partition to new:
mount -t ext3 /dev/hdd2 /mnt/hdd2 mount -t ext3 /dev/hdb1 /mnt/hdb1 cp -axf /mnt/hdd2 /mnt/hdb1
-
Disk is set up but how to boot the o/s? Install grub on a floppy:
fdformat /dev/fd0 mke2fs /dev/fd0 mount -t ext2 /dev/fd0 /mnt/floppy grub-install --root-directory=/mnt/floppy '(fd0)' umount /mnt/floppy
- Put drives and boot floppy in server box and boot from floppy. This gives mysterious grub prompt. Note that all drive entrys in the bios had to be set to 'auto' instead of 'none' for Grub to see them.
-
Enter following commands in grub
root (hd1,0) kernel /vmlinuz root=/dev/hdb1 initrd /initrd.img boot
-
Pc now boots into linux. Kinda good to see it again. Have to set up boot loader on hard disk.
sudo grub-install '(hd0)'
And all is ok. Had to change network settings for old DE220 card as the former DE528 went onto desktop pc. This involved telling the bios that irq9 was allocated to the DE220 and putting
ne io=0x300 irq=9
in /etc/modules.
Copying a system like this is difficult on Windows 2000 and probably XP. You can try using third party tools like Norton Ghost if your boss will buy you them and cross your fingers they don't screw up (for me ghost failed to copy a dynamic disk). I am impressed that the underpinnings of linux are straightforward enough to allow this kind of fixing.
I used a few live CD's in the course of this including the Ubuntu live CD, Damn Small Linux and the System Rescue CD. They all have a problem in taking an eternity to boot up. grub didn't work properly from the Ubuntu live cd it gave 'unknown error 524'. The System Rescue CD booted slightly faster because it didn't attempt to load X but it still took a good 5 minutes to come up.
Interesting to see that the System Rescue CD has an option that appears to let you change the passwords on an NTFS partition. Tut tut.


Very nice site!