GRUB issue: /boot partition was deleted while installing XP
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
GRUB issue: /boot partition was deleted while installing XP
dear all,
Thanks for looking at this
I always seem to have GRUB issues
Anyway, I needed to install WinXP on my HP Dv9500t laptop, for some really annoying software which is only windows and I can't be bothered to wine it. So While installing I wrote over the /boot partition of the hard drive Now there is nothing in boot except for some things that I've made from other pc's. Any idea? Should I just reinstall everything? I don't really want to do that if I don't have to but I will if I must. If I do whats the easyist way to back things up? Make an iso with dd or a tar.gz? and can someone remind me of the commands ?
Thanks,
paul
Code:
root@ubuntu:/# fdisk -l
Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004c869
Device Boot Start End Blocks Id System
/dev/sda1 * 1 555 4458006 7 HPFS/NTFS
/dev/sda2 556 12161 93225195 83 Linux
Disk /dev/sdb: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1248f1c6
Device Boot Start End Blocks Id System
/dev/sdb1 1 32 257008+ 83 Linux
/dev/sdb2 33 12160 97418160 f W95 Ext'd (LBA)
/dev/sdb5 33 542 4096543+ 82 Linux swap / Solaris
/dev/sdb6 543 12160 93321553+ 7 HPFS/NTFS
root@ubuntu:/# mkdir /media/ubuntu
root@ubuntu:/# mount /dev/sda2 /media/ubuntu/
root@ubuntu:/# mount /dev/sdb1 /media/ubuntu/boot
root@ubuntu:/# mount --bind /dev/ /media/ubuntu/dev/
root@ubuntu:/# mount --bind /proc /media/ubuntu/proc
root@ubuntu:/# umount /dev/sdc1
root@ubuntu:/# mount /dev/sdc1 /media/ubuntu/local
root@ubuntu:/# chroot /media/ubuntu/
root@ubuntu:/# ls boot/
grub lost+found
root@ubuntu:/# ls boot/grub/
default device.map menu.lst menu.lst~
grub-install /dev/sda
/dev/sda does not have any corresponding BIOS drive.
grub-install --recheck /dev/sda2
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.
grub-install /dev/sda
Could not find device for /boot: Not found or not a block device.
windows overwrites mbr. You just need to re-install Grub to the mbr of the first drive. If you can't boot from the hardrive use a Live CD, in a terminal type "grub" to get the grub prompt (grub>), then enter:
Sorry forgot to say that. Yes we're using Ubuntu Hardy and no I didn't see the repair option on the live disc. So I booted up the live disc and mounted the hard drives (2 sata HDD) as in my first post. Then I did
this is what I'm saying I wrote over the boot partition. I had to totally remake it. However, i don't have a stage1 or a vmlinuz file anymore because Win XP formatted the boot partition and used it as C:/
Hence when I do do
Code:
root@ubuntu:/boot# grub
Probing devices to guess BIOS drives. This may take a long time.
[ 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> geometry (hd0)
geometry (hd1)
find /sbin/init
find /boot/vmlinuzgeometry (hd0)
drive 0x80: C/H/S = 12161/255/63, The number of sectors = 195371568, /dev/sda
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 1, Filesystem type is ext2fs, partition type 0x83
grub> geometry (hd1)
drive 0x81: C/H/S = 12161/255/63, The number of sectors = 195371568, /dev/sdb
Partition num: 0, Filesystem type is ext2fs, partition type 0x83
Partition num: 4, Filesystem type unknown, partition type 0x82
Partition num: 5, Filesystem type unknown, partition type 0x7
grub> find /sbin/init
(hd0,1)
grub> root (hd0,1)
root (hd0,1)
grub> setup (hd0)
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no
Error 15: File not found
grub>
I get File not found because it's not there. Any way to make it?
So, you were booting out of a separate /boot partition? And it is now gone? (it is certainly not there...). Does that mean your kernel is missing too?
In this event, you will either need to recreate it and put the right stuff in it, or you need to put a /boot directory on your / partition. You should be able to get what you need off of a live CD that matches your distro. This is probably going to mess up your package manager though, but you can fix that.
Just fire up the live CD, remount the partition (sda2, it looks like) that is your system parttion as writable, then copy /boot from the live CD onto it.
I copied over what the live CD had and this is what I got. I probably could mess around and get it all working but with the different kernel version I can't be bothered. My partitions are kind of nasty anyway so fresh install here we come
just FYI I did
root@ubuntu:/# tar cvf /homeDIR_BK.tar /home/*******/
which worked quite nicely but it was too big for gzip otherwise I would do
root@ubuntu:/# tar cvf - /home/********/ | gzip > /homeDIR_BK.tar.gz
here is what the live CD gave and my different kerenl images so ....yea
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.