Disclaimer: This procedure can render your computer unbootable and corrupt your data if you do it wrong. Perform a backup prior to doing it and verify you can read the backup. Don’t attempt it on a critical laptop. I am in no way responsible if you attempt this and end up with an expensive brick or it results in data loss.
1 Dell Latitude D610 with a 60GB HDD
1 IT Guy about to go on holiday but not wanting just to take a Windows XP box
Shrink the XP install down to 30GB and use the new volume to install Fedora 9. Keep the standard windows boot loader (i.e. Nothing to see here move along)
fdisk -l Disk /dev/sda: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x41ab2316 Device Boot Start End Blocks Id System /dev/sda1 1 8 64228+ de Dell Utility /dev/sda2 * 9 7296 XXXXXXX 7 HPFS/NTFS
ntfsresize --info /dev/sda2to get the minimum size of what you can shrink it to. We will be leaving the Dell Utility partition alone the C: drive is /dev/sda2
ntfsresize --info /dev/sda2
ntfsresize -s 30005821440 -n /dev/sda2to test (-n or not really) if it seems OK
ntfsresize -s 30005821440 -n /dev/sda2
ntfsresize -s <size IN BYTES> /dev/sda2to do it for real
ntfsresize -s 30005821440 /dev/sda2
fdisk /dev/sda, make note if the partition you are shrinking has the bootable flag, partition type (7) and start sector. Delete the old partition (/dev/sda2)
fdisk /dev/sda Disk /dev/sda: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x41ab2316 Device Boot Start End Blocks Id System /dev/sda1 1 8 64228+ de Dell Utility /dev/sda2 * 9 3829 30692182+ 7 HPFS/NTFS /dev/sda3 3830 3854 200812+ 83 Linux /dev/sda4 3855 7296 27647865 5 Extended /dev/sda5 3855 7296 27647833+ 8e Linux LVM
dd if=/dev/sda3 of=/media/MYKEY/bootsect.bin count=1 bs=512– I think these days you could mount and write straight to the NTFS partition but when I tried to get Knoppix to write directly to the NTFS partition it complained that the volume was dirty. This, I think, was because I had power cycled when Windows XP was half booted, so I just used the USB key to get a copy of the GRUB bootloader.
dd if=/dev/sda3 of=/media/MYKEY/bootsect.bin count=1 bs=512
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect C:\bootsect.bin="Fedora 9"
I can now go on holidays with a dual boot Laptop containing a standard work OS and a Fedora 9 environment. If I need to give the laptop over to anyone, I can remove the boot.ini entry and hand it to them.
PS. Fedora 9 found the Intel wireless and I could connect straight up to my WAP with no issues. GNU/Linux Rocks!