LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-31-2003, 04:34 PM   #1
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Rep: Reputation: 15
Remove secondary HD (HDB)


OK guys and gals... I've got a problem... and I can't figure out how to fix it... It should be relatively easy, but I cant for the life of me figure it out.

I have a RH9 machine with 2 hard drives.
The Primary hd, hda. contains the /boot, and / partitions.
The secondary hd, hdb, contains /swap, and /server.

The secondary hard drive is bad. It's poping up with write errors all over the place, and is causing sever system slow-down. There is nothing ig importance on this drive, and I would just like to remove it entirely. Being a former windows user, I was aware that in windows, if you don't want a drive anymore, you can just unhook the cable. I Tried that, and noticed that in linux, this is not the case.

Here's what I have tried so far. In the fstab file, i commented out the /server mount option, and that seems to "work". ie. The /server mount-point is empty. But again. when I try to remove the drive I get a kernel panic until i turn off the machine, and plug the drive back in. here are copies of fstab, and df -h, because in reading posts, they seem to be asked for quite often.

fstab:
[root@BEOWULF-SERVER root]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
#LABEL=/server /server ext3 defaults 1 2
#/dev/hdb2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0


df -h:
[root@BEOWULF-SERVER root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 18G 5.8G 11G 36% /
/dev/hda1 99M 14M 81M 15% /boot
none 125M 0 125M 0% /dev/shm


fdisk -l
[root@BEOWULF-SERVER root]# fdisk -l

Disk /dev/hda: 13.6 GB, 13601193984 bytes
255 heads, 63 sectors/track, 1653 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 1653 13173300 83 Linux

Disk /dev/hdb: 19.2 GB, 19259154432 bytes
255 heads, 63 sectors/track, 2341 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 2276 18281938+ 83 Linux
/dev/hdb2 2277 2341 522112+ 82 Linux swap

Any help would be appreciated.

~Jake
 
Old 10-31-2003, 04:42 PM   #2
bluephile
Member
 
Registered: Oct 2003
Posts: 45

Rep: Reputation: 15
This:
Quote:
Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 18G 5.8G 11G 36% /
says that /dev/hdb1 is your root partition! (hdb1 = first partion on hdb) So, of course, unplugging it will cause problems.

Now, ignoring that for a second, if you don't mind powering it off, why can't you turn it off, unplug it, and reboot?
 
Old 10-31-2003, 04:46 PM   #3
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Well... I guess my face is red on that one... I just noticed that myself... So here is my next question. how can I migrate everything on my hdb1 / partition over to hda1??

EDIT:

Of just move it over ho hda in general... there is plenty of space i believe.

~Jake

Last edited by JSylvia007; 10-31-2003 at 04:47 PM.
 
Old 10-31-2003, 05:24 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,898

Rep: Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985
The way I see it.
hda1 - /boot
hda2 - /server
hdb1 - /
hdb2 - swap

hda1 is way too small you will need to use hda2 which is the /server partition. Your choices are to resize hda2 and create hda3 for / or just copy everything over to hda2. And while your at it create a new swap partition as well.

You can use the cp -rp command to copy / from hdb1 to hda2. Then either change the labels of the partitions (e2label or tune2fs) or chnage /etc/fstab with the new partition location of /.

You will also need to update the grub.conf file. Depending on how much RAM you have or if you use swap at all to make things easier just create a swap file. Creating a swap file is slower then a partition but a lot easier to accomplish.
 
Old 10-31-2003, 07:00 PM   #5
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
thanks for the input michaelk... I will try that as soon as i am bak in front of the linux machine... I'll post with results.

~Jake
 
Old 11-02-2003, 08:37 PM   #6
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Ok guys... here's where I'm at. I used Mike's directions, and did a cp to copy over the data...
But i ran into a problem when it tries to copy the /proc filesystem... SOOO... I put back in my RedHat cd, and booted into a clean "rescue" kernel. It then mounted all my volumes inside the /mnt/systemroot/[volname] so... I unmounted all unnecissary mount points, like /mnt/systemroot/proc and the like, and did a cp -rp /mnt/systemroot /mnt/systemroot/server to topy the data from the original / to /server. all went fine. I then did e2label on the drive issuing the following command:
e2label /dev/hda2 /
e2label /dev/hdb1 /server

that should have switched them over to the new volumes. Now however, I get a kernel panic saying this:
Kernel Panic: no init found try passing init= to kerlen

with the second hard drive either plugged in or removed.

I believe this is because I need to edit my grub.conf and possibly edit the fstab file. HOWEVER, I wouldnt know what to change.. here are copies of my grub.conf, and fstab files.

fstab:
[root@BEOWULF-SERVER root]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
#LABEL=/server /server ext3 defaults 1 2
#/dev/hdb2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

grub.conf
the lines that matters i assume would be these

root(hd0,0)
kernel /vmlinuz-2.4.20-20.9 ro root=LABEL=/
initrd /initrd-2.4.20-20.9.img


I'm kinda in a bind here as my website is down until i get this fixed... I would appreciate some help

~Jake
 
Old 11-02-2003, 08:49 PM   #7
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Just as a quick update... If I do:
e2label /dev/hda2 /server
e2label /dev/hdb1 /

The system will boot fine... But this still doesnt fix the problem... I need to get hdb removed... and I have already copied the data as explained in my previous post.

Thanks again

~Jake
 
Old 11-04-2003, 12:09 AM   #8
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
I'm still having this problem, anyone out there have an answer??

~Jake
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't seem to access hdb revenge80200 Debian 8 05-14-2005 08:13 PM
Install doesn't see hdb? RaiderSan Fedora - Installation 5 09-18-2004 02:58 PM
Mounting hd hdb* konastan Linux - Hardware 1 03-29-2003 12:59 PM
format hdb??? pk21 Linux - Newbie 1 11-20-2002 03:44 AM
URGENT!!! adding ide(hdb-secondary hard-disk) to redhat 7.1 gigya Linux - Software 3 05-02-2002 04:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

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