Jesus 'n Jim

A mainly PC (some Mac) site w/Software, Computer Repair Info, How-To's on Using Computers
Technical Support 1-360-521-2060 (my business line cell)

using gparted cd


gparted - that's where you can find it.

here is an article on how to resize windows and reinstall windows or another OS onto the unpartitioned space.

here is an article on how to move the data

I am gravitating more towards the System Rescue CD for file fixes when I can't boot the normal OS, since it doesn't resize the partition or mangle it on startup like gparted might. The System Rescue CD you just boot and use. no fuss, just press Enter a few times and you're in - start fixing.

gparted exists as a livecd, and is also available as a liveusb image.

You will want the 0.3.1-1 release for older machines because it's the last thing that works. Use the latest release for newer machines.
Try the latest to see if it works on the machine first and if it doesn't try the older 0.3.1-1 version. You should probably NOT use 0.3.1-1 with Vista!

Later versions can copy and move and resize a vista partition, however, you will need to know a few things. for vista, copying a system partition invalidates the boot loader. resizing a partition renders Vista unbootable and will require you to boot to your Vista DVD and repair the OS. It is also possible to use GParted to move Vista partition, but you need Vista cd-dvd, to repair Vista Boot Manager. Some details are available here. Summarized steps in a kind of howto.

copying a system xp partition invalidates the boot loader on the destination disk. there is a suggested method for installing grub to boot windows, but know that when copying any system partition, you must disconnect the original disk and leave it alone before booting.

  1. If your computer was in hibernation, boot your computer and take it out of hibernation. it's the best thing you can do. You can't even mount the partition with ntfs-3g or gparted if the windows was hibernated or if it was scheduled for a chkdsk /f at next boot. If you have scheduled a chkdsk /f or chkdsk /f /r on next reboot, reboot and finish that first (gparted will know about it and will choke).
  2. have the cd in the drive before booting the machine, and don't wait until the last second to put it in and hope the drive recognizes it in time (unless you know your drive and system *really* well).
  3. configure CMOS SETUP to boot the cdrom drive before the hard drive, then save the settings. that should cause a reboot.
  4. 2nd trick is to watch for the "press any key to boot cd" prompt while you are booting. Easy to miss, I usually end up doing this twice to get it right... Otherwise it just boots to the hard disk, and we don't want that.
  5. press the Enter key at nearly all the prompts (keyboard type, mouse, display resolution, language, etc).
  6. UNIX should start, avoid starting the GUI (it will ask to start GUI at one of the prompts)!
  7. If you did want to start the GUI, then move, copy, resize your partitions like you want them. Note: copying an XP/2000/Vista system partition will not work. doing this actually requires some registry editing too, among other things... which this tool does not do. Buy a copy of Casper 5.0 if you want to clone XP or upgrade to a larger hard disk.
  8. after you are done doing all your changes, click the apply changes button & go for lunch.
  9. when you are done with gparted, close it.
  10. if you aren't already at a shell prompt, start up an xterm.

ntfs-3g (System Rescue CD, gparted LiveCD)

please note that UNIX is case-sensitive, possibly regardless of NTFS.

The hard way (this also works as a windows system rescue - access the files when you otherwise couldn't boot windows!):

ls /dev/sda*
ls /dev/hda*

(you will be looking for any hda or hdb or hdc sda sdb sdc etc that has a number appended to it - these are partitions. sda=SATA,hda=IDE). actually, it might be better to try this if it works:
ls /dev/[sh]d[a-z][0-9]+
that should grab them all.

mkdir /mnt/c /mnt/d /mnt/e (note that the directory MUST exist before you can mount! there are no drive letter colons in UNIX.)
mount -t ntfs-3g /dev/sda1 /mnt/c
(if this fails, use ntfsfix on the partition - note: it doesn't always work, and it makes Vista unbootable!)
cd /mnt/c

dir is same as ls -al
dir/w is same as ls
Instead of rename or ren or move you use mv
Instead of copy you use cp
Instead of del or delete use rm

missing boot.ini file: making a new boot.ini if you have to - no recovery console

please note that UNIX is case-sensitive, possibly regardless of NTFS.

use vi or emacs (I like vi since it's simpler)to edit boot.ini. the 2nd partition (2) is c: on this old Dell system.

vi /mnt/c/boot.ini
hit i to get into insert mode, type the following text (modify it as necessary), then hit Esc to get out of insert mode, then type ZZ to save the file and exit.

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn

then do
utod /mnt/c/boot.ini
to convert it from UNIX to DOS format. you may have to dig around to find utod, it may be in /bin or /usr/bin or /usr/sbin or one of those off places. if you can't find it, you can always try this:
find -name "utod" -exec {} /mnt/c/boot.ini \; (those are curly brackets over there)

unmounting the partition - finishing up

Remember on UNIX there are no drive letter naming conventions like A: and C:.

Devices (drives) are mounted to a directory like /dev/hda and /dev/sdb or and partitions have a number appended to the device path (/dev/sda1 for partition 1 - partitions start with 1, not 0). Usually you want to mount a partition using -t vfat for FAT12, FAT16, FAT32 and -t ntfs-3g for NTFS. Simply add the partition number to the end of the device path if you want the partition instead of the whole raw disk. When you are done using the ntfs partition, unmount the partition with umount then do init 6 to shutdown the system:

umount /mnt/c or umount /dev/sda1
init 6
after it shuts down, you can remove the cd.

You must make a directory first before you mount to it. then you can mount+unmount a devide to the directory as many times as you like. because the directory is in ramdisk, once the power is turned off, the contents of that ramdisk will be gone.

Please note that there is no provision in gparted for chntpw (change password). chntpw does not include the utility that can make registry changes to the windows registry (but the ISO does). You can find chntpw on the System Rescue cd. The original site and ISO for chntpw is here. On the system rescue cd you can start gparted first by booting with the System Rescue CD and then with startx.

missing boot.ini file: using recovery console

read this yahoo answers question and answers: Invalid boot.ini file

gparted and vista/7, notes

I don't recommend gparted yet for Vista partitions. It is not advanced very far in that direction yet and doesn't work for some operations (move,resize), and some of those operations used to be done on startup, which would mean an OS repair (ack!).

please note that UNIX is case-sensitive, possibly regardless of NTFS.