Click to See Complete Forum and Search --> : How do I get Linux to recognize my second HD?


jasonmeade
01-11-2003, 12:28 AM
Hi,
I am new. Here is my problem. I have 2 hard drives, but I can't figure out how to access the hdb.

here is my story. I wanted to try out linux because I have an old win97 computer I don't really like, and an iMac which is alright, but it is not technically mine. So anyway, I bought a used computer for a few bucks [in the lowish double digits], which has
AMD K6 233MHZ Processor.
3GB Primary hard drive. [this is my hda]
1GB Secondary hard drive. [this is my hdb]
32X CD Drive.
128MB RAM.
AT Keyboard.
Serial Mouse.
10Mbps Network card.

I also got red hat 8.0 for dummies [on sale] which of course has red hat 8.0 on it.

So I installed that and it seemed to work ok [gnome desktop]. I just kind of poked around it to see what it did. So it was fine until I tried to install some more programs on it, when I discovered that my install of 8.0 took up over 2/3 of my hda, so I basically had no room to put anything else on the computer.

So I went looking for my hdb and I could not find it through Nautilus. Then I went looking for it through the file file utility and I could not find it from there [i had already done the "updatedb" command which i guess you are supposed to do].

So I found a utility called "hardware browser" which showed me that yes i did have a
/dev/hdb

[I'll omit the part where it wasn't partitioned at all.]
it is now partitioned like this:
/dev/hdb
hdb1 750MB ext3
hdb2 472MB linux-swap

the hda looks like this [this is how the red hat installer set it up]:
/dev/hda
hda1 98MB ext3
hda2 2618MB ext3
hda3 382MB linux-swap

So anyway, I was getting nothing through the desktop route, so I decided to try going through the terminal.

Unfortunately, it seems that linux for dummies has not anticipated my problem because they have like 4 chapters on how to get from windows to linux and zero on what I need to know about.

I have tried
$ cd /dev/hdb
bash: cd: /dev/hdb: Not a directory

also:
$ cd /dev/hdb/hdb1 [OR hdb2]
which gets the same reaction

So since it said /dev/hdb is not a directory I tried:
$ mkdir /dev/hdb
mkdir: '/dev/hdb' exists but it is not a directory

I know it's not a directory, thats why I am trying to make one, although I dont know if that is what I should be doing or not.

I also tried:
$mount /dev/hdb
mount: can't find /dev/hdb in /etc/fstab or /etc/mtab



If I do:
$ ls -la /dev/hdb
brw- rw- - - - 1 root disk 3, 64 Aug 30 19:31 [and then in black, while everything else is in white it says /dev/hdb ]


I've also tried makedev, but it says bash: makedev: command not found

The dummies book actually has a section on installing a new hard drive, but it is singularly unhelpful.

The only part that looks like it might be helpful is it says- after telling you to make partitions and so on- it says "enter the new file systems into the /etc/fstab, the configuration file"

But it doesn't tell you how to do that. I have poked all through the book, but the first 200 out of 300 pages don't even deal with non-graphical aspects of using linux at all. So i have tried

$open /etc/fstab
$read /etc/fstab
$edit /etc/fstab
$change [or chng] /etc/fstab
$mod [or modify] /etc/fstab

I can't think of anything else that would be the command to open the file. But even if I did get it open, I dont really know what I would do with it after that.

Also in the book it says
"to create a file system on the disk drive partition hdb1 for example, type the following command

mkfs -t ext3 /dev/hdb1"

which I tried even though the hardware browser already shows that hdb1 is ext3, but ti doesnt work either.

So that's about where I am up to now. I am not sure what to do since I can't even figure out how to open a file through the terminal. Would you believe there is nothing in the index under "file" along the lines of "opening" or "editing".


I feel kind of foolish because way back when I was in college the computers were on a VAX system which sems a bit similar, but I can't remember how it worked anymore.

actually I just tried:
$write /etc/fstab
write: /etc/fstab is not logged in

I have no idea what means.

mdwatts
01-11-2003, 08:34 AM
Is there anything on hdb right now? Existing partitions or just a unformatted drive?

If existing Windows partitions, you can use fdisk to delete the partitions.

In a Gnome terminal/commandline/console

su -
<root password>

fdisk /dev/hdb

p (look for existing partitions)

d (to delete existing partitions - specify which one)

w (to write the changes)

fdisk /dev/hdb (again)

n (to add a partition)

Select the entire drive (hdb) and ext2 filesystem (if it asks)

Now format using

mkfs.ext2 -j /dev/hdb1

'-j' creates ext3

When done, use one of the Gnome gui text editors and add

/dev/hdb1 /<mountpoint> ext3 rw,defaults,auto 0 0

You will then need to create a mountpoint directory

cd /

mkdir <mountpoint>

i.e.

mkdir hdb or driveb

x
01-11-2003, 10:19 AM
This is how it works:
1. Hard disks are normally recognized automatically by Linux, you don't have to bother about making the /dev/hdb# stuff.
2. To access a partition, it must be mounted under an existing directory. The usual place is under /mnt
You could issue the mount-command directly from the prompt, but you will have to specify what to mount and where to mount it:
# mkdir /mnt/b1
# mount /dev/hdb1 /mnt/b1
(normally you don't need to specify the file-system, but you probablt have to be root to mount.)
It's easier to put it in /etc/fstab so it's done automatically, as you were trying to do.
/etc/fstab is an ordinary text-file, you open it with any text-editing program you might have. (Only root can do it.)
Here are the names for some text-mode editors:
vi, emacs, jed, joe, mc_edit
(Personally I hate vi & emacs...!)
So you type for instance:
# jed /etc/fstab

Do you have Midnight Commander installed? It's a great text-mode program, just type 'mc' at the command prompt. Install it, if you don't have it!

I hope I managed to explain better than that Dummies-book?