LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how many disks does my system have and how mcuh space does each have? (https://www.linuxquestions.org/questions/linux-newbie-8/how-many-disks-does-my-system-have-and-how-mcuh-space-does-each-have-108118/)

mbhenry 10-24-2003 04:56 PM

how many disks does my system have and how mcuh space does each have?
 
What are the commands to find out how many disks my system has and then what command can I use to determine how much space is on each disk?

atko 10-24-2003 04:58 PM

Which linux are you running? Red Hat, Mandrake......?

slackwarefan 10-24-2003 05:09 PM

Type "df" at the shell. It shows all of your disks and how much space they have. If this does not work try "free".

mbhenry 10-24-2003 05:15 PM

I am running redhat 8.0

df makes it look as though there are two disks ( /dev/hda and /dev/sda) but I know in AIX the lspv command clearly lists how many disks there are.

free didn't seem to help - it just gave me the amount of free memory

itsjustme 10-24-2003 05:23 PM

Try kdf from the command line.

-or-

$ su -
(password)
# fdisk -l

These aren't really gonna show the physical disks, just the partitions, I think.

Do you have a screw driver? ;)

mbhenry 10-24-2003 05:30 PM

kdf is a nice command. It does actually show that there are two disks if I look at the /dev/hda and /dev/sda. I am wondering how to tell if there is a disk that is available but not being used.

fdisk -l does work. It shows the partitions but it also lists the disks. Thanks

crashmeister 10-24-2003 05:36 PM

All the disks you got will be listed under /etc/fstab Anything that isn't in there won't be listed because the kernel can't see it regardless of if it is physically there or not.
To find out what you got in your box look at your BIOS.

mbhenry 10-24-2003 05:42 PM

Actually looking in /etc/fstab does not show that there are actually two disks. I am remotely logged into the machine and so I don't think I can look at the BIOS.

Onemessedupjedi 10-24-2003 05:51 PM

fstab only shows the partitions you set up to run linux or run under linux...
EDIT: and here I go trying to contradict a guru, well, I guess I might be wrong but my fstab only shows the drives I chose to be in there(it didn't show my ntfs ones till I added them)
use cfdisk...it shows it very cleanly, but only one drive. You can probably use an argument to get it to display other drives though(don't know)
guess and check with hda, hdb, hdc, sda, sdb, sdc if you can choose the drive to view.
If your distro doesn't have cfdisk you need to shank them

slakmagik 10-24-2003 06:15 PM

Yeah -
fdisk -l shows all partitions, usually mountable by a complex 'mount' command
fstab shows all partitions mountable by a simple 'mount' command - it supplies the arguments (and more) that you'd have to supply to the command line if the partition *wasn't* in fstab
mtab shows all partitions currently mounted.

fdisk is an app giving a direct report, fstab is a file that you create (or your install tries to do for you), and mtab is an automatically generated file. 'mount' with no arguments displays mtab.

cfdisk's nice enough but fdisk is not so bad - and for a simple report, fdisk -l is better than monkeying with menus.

That being said, I have no idea how networking works - I run standalone, so I don't know if there are other issues with remote filesystems.

crashmeister 10-24-2003 06:40 PM

Remotely - nice!
Have a look at the kernel messages in /var/log and see what that says at the last boot.
Look for something like this:
Oct 24 20:08:23 localhost kernel: hda: SAMSUNG SV4002H, ATA DISK drive
Oct 24 20:08:23 localhost kernel: hdb: Maxtor 2F040L0, ATA DISK drive
Oct 24 20:08:23 localhost kernel: hdc: HL-DT-ST GCE-8320B, ATAPI CD/DVD-ROM drive

About the fstab sure - thats what I was blabbering about - anything that isn't in there won't be seen by the kernel and because of that any commands will not tell you anything about it besides something like 'unable to open device'.
You could try cd /dev and ls but I got :
a) no idea if that shows devices that are detected by the kernel or according to fstab in that respect and
b) it will only help you anything if you use devfs on that machine


All times are GMT -5. The time now is 05:56 AM.