LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Added Hard Drives, Confused by df and mtab (https://www.linuxquestions.org/questions/linux-hardware-18/added-hard-drives-confused-by-df-and-mtab-135238/)

RogueWave 01-15-2004 07:24 PM

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 >

michaelk 01-15-2004 07:45 PM

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?

RogueWave 01-15-2004 08:30 PM

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....

michaelk 01-15-2004 08:43 PM

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.


All times are GMT -5. The time now is 12:29 PM.