You are not logged in.

#1 2007-06-18 00:28:09

tafsen
Member
Registered: 2006-05-03
Posts: 141

How do I get grub back after reinstall of Windows?

I had to reinstall windows, and now grub is gone.  I also messed up my /boot partition, so there are no files there anymore.  How can I get grub back again?

Offline

#2 2007-06-18 03:48:45

Leigh
Member
From: USA
Registered: 2004-06-25
Posts: 533

Re: How do I get grub back after reinstall of Windows?

I'm assuming your dual booting with Arch and Windows. You could boot from the arch install cd. Run the install and mount your arch partitions the same as you did before. Don't let the installer format your partitions! Just select the correct mount points and file systems so they match your already installed system. then run through a base install. The install should only upgrade your system and not over-write any conf files. You can skip the "set root pass word" if you previously set it during your original install. Then install the kernel, and finally grub. The installer gives you many options on where to put grub. Everything should be back to normal. At least this worked for me when I totally trashed my /boot and lost some system files.


-- archlinux 是一个极好的 linux

Offline

#3 2007-06-18 03:55:11

nikron
Member
Registered: 2007-05-15
Posts: 130

Re: How do I get grub back after reinstall of Windows?

Leigh wrote:

I'm assuming your dual booting with Arch and Windows. You could boot from the arch install cd. Run the install and mount your arch partitions the same as you did before. Don't let the installer format your partitions! Just select the correct mount points and file systems so they match your already installed system. then run through a base install. The install should only upgrade your system and not over-write any conf files. You can skip the "set root pass word" if you previously set it during your original install. Then install the kernel, and finally grub. The installer gives you many options on where to put grub. Everything should be back to normal. At least this worked for me when I totally trashed my /boot and lost some system files.

This is assuming that Arch has been completely trashed after installing windows, correct?  If it hasn't you can just chroot into the system and then run grub-install /dev/sda

Offline

#4 2007-06-18 06:06:26

Leigh
Member
From: USA
Registered: 2004-06-25
Posts: 533

Re: How do I get grub back after reinstall of Windows?

nikron wrote:

This is assuming that Arch has been completely trashed after installing windows, correct?  If it hasn't you can just chroot into the system and then run grub-install /dev/sda

Well, if /boot is empty the system might not be totally trashed, but still, you'll need to do more than just reinstall grub. Boot img's will need to be regenerated?


-- archlinux 是一个极好的 linux

Offline

#5 2007-06-18 06:31:16

Zoranthus
Member
From: muc
Registered: 2006-11-22
Posts: 166

Re: How do I get grub back after reinstall of Windows?

Shouldn't it be sufficient to set the boot flag back to the linux disk/partition?

Offline

#6 2007-06-18 08:54:48

tafsen
Member
Registered: 2006-05-03
Posts: 141

Re: How do I get grub back after reinstall of Windows?

Zoranthus wrote:

Shouldn't it be sufficient to set the boot flag back to the linux disk/partition?

Not if the /boot partition is empty?

Offline

#7 2007-06-18 08:59:25

tafsen
Member
Registered: 2006-05-03
Posts: 141

Re: How do I get grub back after reinstall of Windows?

Leigh wrote:

I'm assuming your dual booting with Arch and Windows. You could boot from the arch install cd. Run the install and mount your arch partitions the same as you did before. Don't let the installer format your partitions! Just select the correct mount points and file systems so they match your already installed system. then run through a base install. The install should only upgrade your system and not over-write any conf files. You can skip the "set root pass word" if you previously set it during your original install. Then install the kernel, and finally grub. The installer gives you many options on where to put grub. Everything should be back to normal. At least this worked for me when I totally trashed my /boot and lost some system files.

I don't think I'm able to set the mount points without formating it. Because after I've set a mount point, it asks for a filesystem and I would guess that it format right after that?

Offline

#8 2007-06-18 10:00:28

abhidg
Member
From: City of Kol
Registered: 2006-07-01
Posts: 184
Website

Re: How do I get grub back after reinstall of Windows?

No, it shouldn't format; it has to ask for the filesystem type because it needs to mount it. It will ask if you want to create a new filesystem there, then  you should say no.

Offline

#9 2007-06-18 10:50:34

Leigh
Member
From: USA
Registered: 2004-06-25
Posts: 533

Re: How do I get grub back after reinstall of Windows?

Just select the file system that the partitions were previously set to. Then when it asks if you'd like to format/create a new filesystem, there should also be a warning saying that "all data on this partition will be lost". Just select No. So in effect, your basically just upgrading base over your already installed system.  I would do it with the ftp base install cd so your getting the most recent packages. When I got to the point to verify the conf files, I was relieved to see that they had not changed. I checked each one anyway, but I don't think I had to alter any of them. Of course you might need to alter the the grub menu.lst after installing grub, since it's one of the files that's being replaced.


Edit....
               It's been a long time since I used windows. At least four years, but I do remember something about windows needing to be on the first partition, or needing access to the first so many blocks of the disk. You might want to check your partition order/layout. If your linux boot partition is the first partition on the disk and your windows install is towards the end of the disk, this might explain why your /boot partition is empty. Windows could be utilizing it?  I could be wrong though. It's been a long time since I messed with a windows install.

Last edited by Leigh (2007-06-18 13:12:24)


-- archlinux 是一个极好的 linux

Offline

#10 2007-06-18 15:54:36

emmybear
Member
Registered: 2007-04-20
Posts: 38

Re: How do I get grub back after reinstall of Windows?

Firstly, you need your Arch install CD, which I assume you already have. You also need the memory of where your partitions for the root partition and any other mission critical partitions are if you split the filesystem anymore than that.

Now, insert the Arch install disc and boot to it. Remember to replace hda|hda1 in /dev/hda|/dev/hda1 with the device that actually refers to your hard drive and/or partion number. For example, /dev/sda for the first SCSI hard disc, or /dev/hdb for the slave drive on the primary IDE channel. /dev/hdc and /dev/hdd are the master and slave of the secondary IDE channel respectively. From there, /dev/hda1 is the first partition of the master disc on the first IDE channel, hda2 the second, and so on. You might already know of this, but I am simply adding it in case you do not to prevent the need for even more posts. ;3

Once you know which device node to use, perform the following actions.

mount /dev/hda1 /mnt

# Now mount any other partitions, such as /boot, to /mnt/<wherever>.

chroot /mnt
grub-install /dev/hda

You may also need to run /etc/start_udev. If that throws up errors, type exit, run the setup, and go to the part where you install GRUB. From there, all the files should be set. Cheers.

Offline

Board footer

Powered by FluxBB