LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Switching master/slave drives (https://www.linuxquestions.org/questions/linux-hardware-18/switching-master-slave-drives-251782/)

pickarooney 11-06-2004 09:11 AM

Switching master/slave drives
 
I've realised that my hard drives are set up badly.
I have a 40GB Maxtor drive @ 5600 rpm as master (hda) and a 80GB Western Digital @ 7200 rpm as slave (hdb).

My problem is that I'm having trouble figuring out what parts of my system are on what disk. I had always though that the root partition, swap partition, MBR and LILO were on the big disk, but this seems not to be the case.

When I disconnect the small disk and put the big one as master, I get the LILO screen, but soon after selecting the default kernel I get a kernel panic error and booting stops.

in the / directory, typing df -k . gives :
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/ide/host0/bus0/target1/lun0/part1
5542276 3703712 1557028 71% /

typing it in /home gives:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/ide/host0/bus0/target1/lun0/part6
71133144 64045548 7087596 91% /home

In /boot I get:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/ide/host0/bus0/target1/lun0/part1
5542276 3703736 1557004 71% /

These all seem to be part of the same (bigger) drive, so I don't know why the system won't boot without the smaller drive, or even with it as slave. I tried changing the boot order from HD0 to HD1 but it didn't help. I don't know which drive is HD0 and which is HD1.

Harddrake information for hda and hdb

Using Mandrake 10.0 and kernel 2.6.3-13mdk if it's any help.

Can anyone tell me what I might be overlooking and how to resolve this problem?

Thanks,
P

michaelk 11-06-2004 09:50 AM

Basically switching drives will mess up everything because now what was hdb is now hda and lilo can't find anything.

Your /etc/fstab file will show how each partition is mounted. Post the file.

Also look at the /etc/lilo.conf file this will tell you where lilo is being written to.

pickarooney 11-06-2004 10:30 AM

so it only assigns the drive letters at bootup based on their positions? Ahhh, makes sense now. Thanks for the help. Looking again at what I posted above, it seems the / and /boot partitions are actually on the small one.

FSTAB looks thus:
Code:

/dev/hdb1 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hdb6 /home ext3 defaults 1 2
/dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-15,codepage=850,noauto,ro,exec 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=iso8859-15,sync,codepage=850 0 0
/dev/sda4 /mnt/usb vfat defaults 0 0
/dev/hda1 /mnt/windows vfat umask=0,iocharset=iso8859-15,codepage=850 0 0
none /proc proc defaults 0 0
/dev/hdb5 swap swap defaults 0 0

lilo.conf begins like this:
Code:

boot=/dev/hda
map=/boot/map
default="linux"
keytable=/boot/uk.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
        label="linux"
        root=/dev/hdb1
        initrd=/boot/initrd.img
        append="devfs=mount acpi=ht splash=silent"
        vga=788
        read-only

so the boot is on the small drive. This is a bit of a mess, eh?

michaelk 11-06-2004 01:30 PM

The bootloader is being written to /dev/hda. You might of saved the bootloader to the second disk at sometime in the past.

It appears that linux is installed to the 2nd drive and according to you hdb is the big disk.
Your / partition is /dev/hdb1
Your /home is /dev/hdb6
And your swap is /dev/hdb5

And windows is on the first drive. Do you still use windows? If so then I do not see the need to change anything. So explain again what you want to change.

pickarooney 11-06-2004 08:15 PM

There's no Windows OS, but the small HD is a FAT32 partition, thath I use for temporary storing files copied from PCs.

The slower drive is master which I think slowing down teh performance of the bigger, faster drive.
I want to boot to the bigger drive and have it as master with the smaller drive as slave, only serving for temp storage.

I should be able to boot with only the big drive connected, als

Hope that's clearer.

michaelk 11-06-2004 08:48 PM

Having the slower drive as slave instead of master is not going to change the performance of the faster drive.

So exchange the drives as master / slave.
Boot the install CD to rescue mode. The / partition will be mounted. I do not remember the exact directory name. /mnt/???. If not then manually mount it. Remember it is now /dev/hda1 instead of /dev/hdb1.

Enter the command:
chroot /mnt/??? (where /mnt/??? is your / partition)
Then edit the /etc/fstab file to exchange what was /hdb with /hda and vice versa.

Next edit the /etc/lilo.conf file and change hdb to hda.
Rerun the lilo command to rewrite the changes to the MBR.
/sbin/lilo

Reboot the PC and if everything goes as planned your OS should boot.

pickarooney 11-07-2004 11:45 AM

Thanks. If the / partition isn't automatically mounted, how am I going to know the directory name (/mnt/???) to do it manually?

I was advised that there may be a problem of interference with the two drives (my hdparm -tT results are terrible and video playback is very jeky from the HD), so I wanted to check if there was an improvement by taking the smaller driver out of the equation. If you tell me that it doesn't matter which drive is master and which is slave, then I suppose I can skip swapping the jumpers and just reassign the boot partition to the bigger drive.

michaelk 11-07-2004 12:03 PM

Quote:

If the / partition isn't automatically mounted, how am I going to know the directory name (/mnt/???) to do it manually?
You create a directory using the mkdir command and then mount the partition to that directory.

pickarooney 11-07-2004 12:36 PM

Sorry, I'm just not getting it. I rebooted in rescue mode and picked the option to reinstall the boot partition, but it just put it back in the same place, without asking me where it should go.
So I disconnected the small drive and rebooted in rescue mode. Asked it to reinstall the boot loader and it hung.
Rebooted and went in to install/upgrade to try and remake the partitions, or even reinstall the OS if there was no otehr way around, but I got an error message saying there was no valid hard drive available to create a boot partition.

???

michaelk 11-07-2004 02:33 PM

So I guess the computer doesn't boot anymore?
So how are the drives configured at the moment?

pickarooney 11-07-2004 02:44 PM

I switched them back to the original configuration so I could boot. Back to square one then. Sorry.

pickarooney 11-08-2004 01:02 PM

Going to try diskdrake to create a boot partition on hdb. Wish me luck... :D


All times are GMT -5. The time now is 05:37 PM.