LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 06-28-2005, 12:17 AM   #1
Zarneth
LQ Newbie
 
Registered: Jun 2005
Location: Australia
Distribution: Debian
Posts: 21

Rep: Reputation: 15
Question Grub troubles. Moving linux from hda to hdb


It seems windows is entirely incabable of booting from anything but hda so I took a friends sujestion and tried to move my linux drive from hda to hdb, however I seem to be having problems getting it to boot. I'm not too fussed about getting window's in the grub boot menu as I can use f11 in my bios to select the drive to boot from.

I'm using Debian Sarge RC and Grub. I edit the grub and fstab to load hdb instead of hda but when I boot grub gives me this error.

Code:
root (hd1,0)
Filesystem type unknown, partition type 0x7
kernel /boot/vmlinuz-2.6.8-2-k7 root=/dev/hdb1 ro

Error 17:cannot mount selected partition

press any key....
If I select the old grub menu option for hda (even thoguh the drive is now on hdb) it actuially seems to boot normally for a moment before stopping with some errors.
(note, I've also since upgraded to kernel 2.6.11-1-k7 but haven't tried with that as I assume it's not the problem)

to change the drive from hda to hdb I used the grub module for webmin to duplicate and edit the entry and editid my fstab file to change hda to hdb.

extract from /boot/grub/menu.lst
Code:
title		Debian GNU/Linux, kernel 2.6.8-2-k7 
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.8-2-k7 root=/dev/hda1 ro 
initrd		/boot/initrd.img-2.6.8-2-k7
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-k7 (HDB)
root (hd1,0)
kernel /boot/vmlinuz-2.6.8-2-k7 root=/dev/hdb1 ro 
initrd /boot/initrd.img-2.6.8-2-k7
the second option is the edited one made by webmin for booting off hdb.

extract from /etc/fstab
Code:
/dev/hda1       /               reiserfs notail          0       1
/dev/hda6       /home           reiserfs defaults        0       2
/dev/hda5       none            swap    sw              0       0
And I just change the hda's to hdb's when I'm trying to boot with the hard drive on hdb.

Anyone know what's going wrong here? Thanks.
 
Old 06-28-2005, 05:42 PM   #2
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Did you alter the boot order in the Bios ?

Yes, windows will only boot if it thinks it is on the first drive (fickle child that it is), however it is easy enough to fool it into booting anyway by passing mapping parameters to it from Grub (see below). My advice would be to restore your Bios and hd locations to how they were, return /etc/fstab and menu.lst back to what you had before, and then append the following to your Windows entry
Code:
map             (hd0) (hd1)
map             (hd1) (hd0)
Cheers,

mj
 
Old 06-28-2005, 10:11 PM   #3
Zarneth
LQ Newbie
 
Registered: Jun 2005
Location: Australia
Distribution: Debian
Posts: 21

Original Poster
Rep: Reputation: 15
Wow. your idea worked. o.o

Thanks. You'e awesome. =D
 
Old 06-29-2005, 04:57 PM   #4
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Glad it worked

Cheers,

mj
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where do I put Grub? hda (XP) or hdb(FC2)? TimDog Fedora - Installation 1 10-04-2004 05:56 PM
Trying to uninstall Grub, Win2000 on HdA; RH9 on HdB? jlbincr Linux - General 4 02-21-2004 10:48 AM
moving hdb to hda linux inside Linux - Software 2 08-13-2003 04:57 PM
[HELP] GRUB problems!!! (WindowsXP-hda / RedHat8.0-hdb) jpsrm Linux - General 7 01-08-2003 09:20 AM
moving the HD from hdb to hda NGraphiX Linux - General 2 10-07-2002 04:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration