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 - 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 01-15-2004, 07:24 PM   #1
RogueWave
LQ Newbie
 
Registered: Jan 2004
Location: Toronto, Canada
Distribution: slackware
Posts: 13

Rep: Reputation: 0
Added Hard Drives, Confused by df and mtab


Hi,

I'm a Linux newbie, and have just installed slackware running kernel 2.4.22.

After doing the initial installation, I fished out two old hard-drives, and added them to my PC. They were correctly picked up by my bios, and I was able to partition, format, and mount them in Linux. They are on my secondary ide slot, if that matters. They each have a single partition and are on /dev/hdb1 and /dev/hdc1 respectively.

The only problem is... I can't see them when I run the "df" command (I see all my original partitions on /dev/hdaX, no problem there). I can see them from the root, using "ls -l", I can cd there and "touch" a file, but I can't see them in "df". I googled this as best I could, and found some references to /etc/mtab, so I edited that. The drives/partitions now show up, but the information seems incorrect, e.g. both drives show the same amount of space, even though they are different sizes.

I also found out about /proc/mounts, and sort of got caught up in linked and read-protected files, and wasn't sure if I should go messing with that.

Is there some way to remount these file systems correctly, and update mtab, and get something more reassuring out of "df"? I've attached some output below

Thanks...

root:/etc > fdisk -l

Disk /dev/hdc: 1624 MB, 1624670208 bytes
64 heads, 63 sectors/track, 787 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 787 1586560+ 83 Linux

Disk /dev/hda: 13.0 GB, 13020069888 bytes
255 heads, 63 sectors/track, 1582 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 12 96358+ 83 Linux
/dev/hda2 13 1582 12611025 5 Extended
/dev/hda5 13 134 979933+ 82 Linux swap
/dev/hda6 135 438 2441848+ 83 Linux
/dev/hda7 439 742 2441848+ 83 Linux
/dev/hda8 743 1046 2441848+ 83 Linux
/dev/hda9 1047 1350 2441848+ 83 Linux
/dev/hda10 1461 1582 979933+ 83 Linux

Disk /dev/hdb: 1281 MB, 1281982464 bytes
64 heads, 63 sectors/track, 621 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 621 1251904+ 83 Linux
root:/etc > df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda6 2365268 49448 2193728 3% /
/dev/hda7 2365268 974116 1269060 44% /usr
/dev/hda8 2365268 2380 2240796 1% /home
/dev/hda9 2365268 32276 2210900 2% /var
/dev/hda10 949204 28 900180 1% /tmp
/dev/hdb1 2365268 49448 2193728 3% /data1
/dev/hdc1 2365268 49448 2193728 3% /data2
root:/etc > cat /etc/mtab
/dev/hda6 / ext2 rw 0 0
/dev/hda7 /usr ext2 rw 0 0
/dev/hda8 /home ext2 rw 0 0
/dev/hda9 /var ext2 rw 0 0
/dev/hda10 /tmp ext2 rw 0 0
/dev/hdb1 /data1 ext2 rw 0 0
/dev/hdc1 /data2 ext2 rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
proc /proc proc rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
root:/etc >
 
Old 01-15-2004, 07:45 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
You shouldn't edit the mtab file. It is used by the OS when filesystems are mounted and unmounted.

The drives need to be mounted before df will report information.

Did you manually mount the drives using the mount command?

Did you add an entry to the /etc/fstab?
 
Old 01-15-2004, 08:30 PM   #3
RogueWave
LQ Newbie
 
Registered: Jan 2004
Location: Toronto, Canada
Distribution: slackware
Posts: 13

Original Poster
Rep: Reputation: 0
I was sure I had mounted those file systems, however, I went back and ran the mount command, and now everything looks fine. I'm thinking must have done something goofy and missed the mount commands the first time around.

Anyway, now df does what I expect, and mtab reflects these file systems (this after I went back and took out the manual changes I described earlier).

I had a look at fstab, and it does NOT contain hdab1 and hdac1... is that ok, or do I have to do something else?

Thanks for your help....
 
Old 01-15-2004, 08:43 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
It is ok but adding an entry in the fstab will automatically mount the partitions at boot. It will also setup for a fsck check at boot too. See man pages for mount and fstab for options.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drive partitions not set up in fstab/mtab odyssey84 Linux - Newbie 6 10-18-2005 07:59 AM
added new HD as master, partitions on old drives are no longer recognized blames Linux - Hardware 2 12-21-2004 04:54 PM
External Hard Drives/Hard Drives ddrfreak Mandriva 1 12-16-2004 06:12 PM
very confused (hard drive, 48 bit lba) thing0 Linux - Hardware 2 04-03-2004 04:09 PM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM

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

All times are GMT -5. The time now is 08:37 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