Okay, Old-Polack,
Yes, this is a Hitachi 160. Hey, I'm actually very technically minded and can handle anything you need to do - I just have little experience in this field. Whatever is easiest for you is just fine for me. I'm not at all afraid of commands - just know nothing about them. I was thrilled to move from DOS to a GUI as well. So, where do we start?
The first thing to do is backup any personal data you can get off the drive, if that's not already been done, and if it's still possible. Usually once one has arrived at this stage, it's too late for that, so one just does the procedure.
We start with booting into the
liveCD, logging in as
root, then opening a
terminal. The first thing to do is
wipe the
MBR with the
dd command. Pressing the
Enter key after each command is a given.
[root@localhost ~]# dd if=/dev/zero of=/dev/hda bs=512 count=1 This writes zeros to each bit of the first 512 byte sector of the hard drive, effectively erasing any information that currently exists there.
Next we use the
fdisk application to create the
partition table, with the exact same
cylinders as before.
[root@localhost ~]# fdisk /dev/hdaThe number of cylinders for this disk is set to 20023.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m <-- We use the command m to see the command menu.Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
<-- Note all commands are single letters, spelled out here p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): oBuilding a new DOS disklabel with disk identifier 0xac74ac74.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
The number of cylinders for this disk is set to 20023.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p <-- To print the partition table, which should now be emptyDisk /dev/hda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xac74ac74
Device Boot Start End Blocks Id System
Command (m for help): n <-- Command n for new.Command action
e extended
p primary partition (1-4)
pPartition number (1-4):
1First cylinder (1-20023, default 1):
<Enter> <-- To accept the default.Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-20023, default 20023):
11099Command (m for help): nCommand action
e extended
p primary partition (1-4)
pPartition number (1-4):
2First cylinder (11100-20023, default 11100):
<Enter> <-- To accept the default.Using default value 11100
Last cylinder, +cylinders or +size{K,M,G} (11100-20023, default 20023):
19896
Command (m for help): nCommand action
e extended
p primary partition (1-4)
pPartition number (1-4):
3First cylinder (19897-20023, default 19897):
<Enter> <-- To accept the default.Using default value 19897
Last cylinder, +cylinders or +size{K,M,G} (19897-20023, default 20023):
<Enter> <-- To accept the default.Using default value 20023
Command (m for help): p <-- To print the new partition table, as is.Disk /dev/hda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xac74ac74
Device Boot Start End Blocks Id System
/dev/hda1 1 11099 89152686 83 Linux
/dev/hda2 11100 19896 70661902+ 83 Linux
/dev/hda3 19897 20023 1020127+ 83 Linux
Command (m for help): t <-- To change a partition's system id.Partition number (1-4):
1Hex code (type L to list codes):
7Changed system type of partition 1 to 7 (HPFS/NTFS)
Command (m for help): tPartition number (1-4):
3Hex code (type L to list codes):
82Changed system type of partition 3 to 82 (Linux swap / Solaris)
Command (m for help): p <-- To check the changes.Disk /dev/hda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xac74ac74
Device Boot Start End Blocks Id System
/dev/hda1 1 11099 89152686 7 HPFS/NTFS
/dev/hda2 11100 19896 70661902+ 83 Linux
/dev/hda3 19897 20023 1020127+ 82 Linux swap / Solaris
Command (m for help): w <-- To write the partition table to the hard drive, and exit.I can't do that command without destroying my own partitions, so I just use
q to quit without saving changes. You will get a message about the new partition table being usable after the next boot, or some such, or possibly without rebooting, after issuing the command
partprobe. Just to be sure, issue the command, then try fdisk -l to see for sure that the running kernel sees the new partitions.
[root@localhost ~]# partprobe /dev/hdaYou will get a popup window for each partition found. Just click
Cancel for each, or
Open with Konqueror, if you want to see the partitions mounting and view the content, which should all still be there.
[root@localhost ~]# fdisk -lDisk /dev/hda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xac74ac74
Device Boot Start End Blocks Id System
/dev/hda1 1 11099 89152686 7 HPFS/NTFS
/dev/hda2 11100 19896 70661902+ 83 Linux
/dev/hda3 19897 20023 1020127+ 82 Linux swap / Solaris
If you get this far
without errors, it's time to install
grub to the
MBR.
[root@localhost ~]# grub GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> <-- This is the grub prompt. Yours won't be blue.
We know that grub exists on /dev/hda2 in the /boot/grub/ directory. We can ask grub to find the stage2 file there, to verify that it still exists.
grub> find /boot/grub/stage2 (hd0,1)
Having found the file, we tell grub to use that partition to install from.
grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0) Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.lst"...
succeeded
Done.If you see the succeeded and Done, grub is properly installed.grub> quit[root@localhost ~]#You will see a message about
Probing devices to guess BIOS drives. This may take a long time. which is actually a left over from grub starting.
Ignore it.
From this point you should be ready to try booting to the installed system again.
Post your results.