[NTLUG:Discuss] Grub assistance

burton at smallnetsolutions.com burton at smallnetsolutions.com
Tue Jan 22 20:39:08 CST 2008


Tom's right - when you pull the old drive, sdb will become sda and won't have an MBR.  You will need to do two things...


(1) Install grub into the MBR of what is now /dev/sdb.
(2) Fix up any references to /dev/sdb to be /dev/sda.

The easiest way to do this is to pull the drive boot off a live cd or repair cd.  You can then chroot and do the grub install command.  Something like this: http://www.linuxforums.org/forum/redhat-fedora-linux-help/66122-install-mbr-grub-knoppix.html should work.

You will also need to fixup /etc/fstab (that's #2, above).

After that, it *should* boot.


If this drive is nicely setup for your MythTV config and you don't want to lose it, do a partition/drive image backup before you touch anything, naturally.




-----Burton



The question is not how to edit the grub.conf. The question is where is 
you Master Boot Record (MBR). If, as is more than likely, the MBR is on 
the Windows drive, removing that drive will render the system 
unbootable. The safest way around that is to back up your Linux disk (at 
least the data), remove the Windows disk, reformat the Linux disk, 
reinstall Linux and then restore your data. In the very unlikely event 
that the MBR is on the Linux disk, you should be able to remove the 
Windows disk and then delete the everything from "title Other" down. I 
would suggest you go to: www.gnu.org/software/grub/manual/grub.htm to 
read up on GRUB before doing anything. You should definitely back up you 
Linux disk before doing any thing.

Mike LaPlante wrote:
> Okay, I have a Fedora 7 system that has /dev/sda as a windows drive, and 
> /dev/sdb as linux. However, I haven't booted the windows drive in over a 
> year so I was wanting to pull that drive out of the system.
> 
> My concern is that this will piss off grub. I'm thinking before I do 
> that I need to change some lines in grub. I'm just not sure which ones I 
> need to mess with. Also wonder if I need to mess with fdisk and change 
> the boot partition.
> 
> Here is my current grub.conf
> ----------------------------------------
> # grub.conf generated by anaconda
> #boot=/dev/sda
> default=0
> timeout=5
> splashimage=(hd1,1)/grub/splash.xpm.gz
> hiddenmenu
> title Fedora (2.6.23.12-52.fc7)
>         root (hd1,1)
>         kernel /vmlinuz-2.6.23.12-52.fc7 ro root=LABEL=/1 noapic
>         initrd /initrd-2.6.23.12-52.fc7.img
> title Other
>         rootnoverify (hd0,0)
>         chainloader +1
> ---------------------------------------------
> And here is the output of fdisk -l
> ------------------------------------------
> Disk /dev/sda: 61.4 GB, 61471162368 bytes
> 255 heads, 63 sectors/track, 7473 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1   *           1        3824    30716248+   7  HPFS/NTFS
> 
> Disk /dev/sdb: 120.0 GB, 120000000000 bytes
> 255 heads, 63 sectors/track, 14589 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdb1   *           1        6374    51199123+   7  HPFS/NTFS
> /dev/sdb2            6375        6387      104422+  83  Linux
> /dev/sdb3            6388        6648     2096482+  82  Linux swap / Solaris
> /dev/sdb4            6649       14589    63786082+   5  Extended
> /dev/sdb5            6649       14589    63786051   83  Linux
> 
> 
> Note it appears I left an NTFS partition on the second drive. I forgot 
> all about that until just now. >.<
> 
> So do I need to change the commented out boot=/dev/sda in grub? No idea 
> why its commented out, I've never touched the file. And I think I would 
> need to change the root lines to root (hd0,1) or something like that?
> 
> Thanks
> Mike
> 
> 
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
> 
> 
> 


-- 
Tom Hayden III

Coherent solutions for chaotic situations

tom.hayden.iii at mail.airmail.net
214-435-4174

2636 Verandah Ln.
Apartment 1431
Arlington Texas, 76006

_______________________________________________
http://www.ntlug.org/mailman/listinfo/discuss



More information about the Discuss mailing list