Click to See Complete Forum and Search --> : changing swap partition location


wdwr14
05-16-2003, 08:09 PM
I recently changed my config of hard drives; I used to have my linux drive set as a master and another drive as its slave, but now it's vice versa. I tried getting into Linux both through my 3rd party boot manager as well as the boot disc. Neither of those methods worked. I then tried to reinstall linux (RH9 BTW), and I got a mssg saying something to the effect of "Not able to enable swap partition /dev/hde5." I now have my RH set up on hdf rather than hde.

My question is this...what do I need to do to tell RH to look for my swap partition elsewhere. I am what most call a Linux "newbie" and I do have some stuff installed on the system that would proly take a while for me to go back and set up again. Thus I would GREATLY appreciate it if someone could help me out here so that I don't have to wipe it and start over. Many thanks!!

-wdwr14

quip
05-16-2003, 08:27 PM
This is just an idea from another newb, but do you have a boot floppy? Or maybe any boot medium for that matter. If you do, you might be able to pass some boot parameters, such as where to look.
I say this because I have been attempting isntalls on several linux distros recently (successful a couple of times ;) ) and each time I had to use a boot floppy cause my old machines won't boot from cds. Anyway, during each boot it would give me a chance to specify some boot parameters, such as where to look. This might work for you.
hth

st0rmrd
05-16-2003, 08:57 PM
I think both LILO and GRUB have the ability to pass parameters to the kernel... actually I do it all the time, and never had a problem.

what parameters you'd ask. well check your manuals.

what I'm sure of is the root=/dev/hd?? where the first ? is a letter (usually a-d) and the second ? is a number, which you'll need to guess or know or just try some combinations, start from 1 and up

but my question is this. how come you have hde and hdf... the usual stuff is Two IDE cables on the motherboard, a primary IDE cable and a secondary IDE, and each cable can hold up to two devices, a master and a slave, ending up with this:

/dev/hda Primary Master
/dev/hdb Primary Slave
/dev/hdc Secondary Master
/dev/hdd Secondary Slave

are you using some PCI card that holds your extra IDE devices, and is that functioning correctly. Maybe you're wrong pointing to hde and/or hdf

double check it.

my guess is that your swap partition is on /dev/hdb5, while your root partition (mounted at /) is /dev/hdb4 or /dev/hdb6...

I don't remember the parameter for telling the kernel where the swap is, but I REALLY think that's the job of /etc/fstab... so if you have any way to access /etc/fstab, then change the values in there...

my swap partition is declared thus in fstab:

/dev/hdb2 swap swap pri=42 0 0

(the above is in one line, not two)

good luck

wdwr14
05-16-2003, 09:29 PM
Believe it or not I am absolutely 100% correct in saying 'hdf.' The reason for this is because I have a board with a RAID controller on it. My Linux installation is now on the 80GB master on IDE3. I have one WD hard drive on IDE1 and 2 CD-ROM drives on IDE2. Actually, I am getting hdf from the RH installation itself. When it asked which RH install I wanted to reinstall, the only one that was listed was on hdf. If that is wrong, then I don't know what to tell you.

I have a feeling that you are correct in saying that the config I need to change is in fstab; however, if I could even GET to fstab I wouldn't be posting this to start with. The parameter I need to know is what pass to the kernel in order to change the location of the swap partition. That should have been my question from the beginning. Thank you...

st0rmrd
05-16-2003, 09:39 PM
if GRUB is working, or if you can use a cd to boot the system (at what point of the booting the swap error comes up?) with this parameter

init=/bin/bash

if it can't find / or /bin try the root=/dev/hdwhatever you think is right, you may have to try it a couple of time till you get it right (try hde also, if it's a possibility, even a remote one)... another thing... a knopix cd would suit you just fine, if you can get it from a linux magazine or from the internet, or have a friend burn you one

in case you don't know what I'm talking about knopix (or knoppix or something like that) is a linux distro that runs directly off the cd, so that should make you able to mount your root file system and do any changes you want...

but go with your boot floppy or cd...

wdwr14
05-16-2003, 10:43 PM
I get that mssg when I try to reinstall RH. When I boot off the floppy, everything goes fine until I get a kernel panic error...(I don't recall exactly what that mssg said). Upon booting off the floppy, I am able to pass parameters to the kernel, and that is what I am hoping to find an answer to. Something like 'swap=/dev/hdf5' perhaps?

Thanx again 4 the help...

st0rmrd
05-16-2003, 11:00 PM
I'll check my SuSE manual but don't count on it. I really think it's not going to be a kernel parameter.

Just boot from your floppy and add only init=/bin/bash

this should bring you to a konsole and you'll have to give your root password and voila!

if that gets you nowhere try the swap=/dev/hde5 or /dev/hdf5

I'll check while you try this and I'll be back one last time before I'm off to have a good sleep (it's 6 a.m. here!)

st0rmrd
05-16-2003, 11:19 PM
checked my manual, nothing.

did a quick search in this forum, only problems with root partition

go with knoppix, or if you feel you can handle it, and can't download a full cd off the web, get a small linux distro than can fit in a cd with vi and mount, and mount the your root filesystem, change fstab and you're ready

I hope someone more experienced picks up from here to help you...

and make sure you make a good google search

wdwr14
05-16-2003, 11:27 PM
Aight thx man...I appreciate the help. I'll try the things you said as well as look into some google searches as well as my RH 7.2 bible.

Anyone else out there with an opinion is more than welcome to share it!!

DMR
05-17-2003, 04:02 PM
As others have said, it's the /dev/hdx drive entries in /etc/fstab that you'll need to edit to point to the new /dev/hdf location of the drive.

You can boot into rescue mode from your 1st installation CD and mount your partitions from there in order to get to /etc/fstab. You can find specific instructions for using rescue mode in the online manuals on Redhat's support site.