LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2007, 08:39 AM   #1
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Rep: Reputation: 0
How do I find how much disk space I have?


I know I am supposed to be to use df -h to see the space amounts for mounted disk and fdisk -l is supposed to list partitions (and does on one of my Linux systems but does not on another). I tried using parted -i but it does not produce anything. What can I use to determine how much physical hard drive space there is on a Linux server then see how much is available to acclocate. I do not know the file names of the dsk devices.
 
Old 01-31-2007, 10:17 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
On the machine where you can't run fdisk, it's probably just not in the PATH for the user which you are trying to execute it under. Specify the full path in this case. It's probably /sbin/fdisk or /usr/sbin/fdisk.
 
Old 01-31-2007, 10:31 AM   #3
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Either way I run fdisk -l nothing is printed to the screen. When I run it I do not get an error just the command prompt coming back to the next line. I am running as root.
 
Old 01-31-2007, 10:38 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
In addition to running it as root you need to specify the device with full path, like
Code:
fdisk -l /dev/hda
or if you happen to have a SATA disk, it's usually something like
Code:
fdisk -l /dev/sda
it doesn't seem to find the devices if you just type the name.

EDIT: 'hda' stands for 'harddisk a', usually your primary harddisk. Following that, your secondary harddisk (if any) is probably 'hdb'; partitions are indicated with numbers like 'hda1' for the first partition of your primary harddisk, 'hda2' for the second and so on. On SATA devices, if I'm not mistaken, it's similarily 'sda', 'sdb' and o on.

Last edited by b0uncer; 01-31-2007 at 10:40 AM.
 
Old 01-31-2007, 10:58 AM   #5
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Entering fdisk -l /dev/hda resulted in the following:
"Disk /dev/hda: 72 MB, 72022016 bytes
255 heads, 63 sectors/track, 8 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/hda doesn't contain a valid partition table
[root] #"
If I enter the command using /dev/hdb or any other leter or even using sda it simply goes back to the command prompt.
The server has four 36.4 GB physical drives.
 
Old 01-31-2007, 11:35 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
What does the "mount" command show?
 
Old 01-31-2007, 11:56 AM   #7
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Here are the results from the mount caommand:
[root]# mount
/dev/VG00/lvol0 on / type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
/dev/VG00/lvol5 on /home type ext3 (rw)
/dev/VG00/lvol4 on /opt type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/hcivg/lvhci on /quovadx type ext3 (rw)
/dev/VG00/lvol1 on /tmp type ext3 (rw)
/dev/VG00/lvol2 on /usr type ext3 (rw)
/dev/VG00/lvol3 on /var type ext3 (rw)
/dev/cdrom on /mnt/cdrom type iso9660 (ro,nosuid,nodev,user=hci)
[root]#
 
Old 01-31-2007, 12:04 PM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
what about
df -h
 
Old 01-31-2007, 12:21 PM   #9
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Here is the results from dh -l
[root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/VG00/lvol0 985M 140M 796M 15% /
/dev/cciss/c0d0p1 97M 16M 77M 17% /boot
/dev/VG00/lvol5 2.9G 35M 2.8G 2% /home
/dev/VG00/lvol4 2.0G 75M 1.8G 4% /opt
none 1004M 0 1004M 0% /dev/shm
/dev/hcivg/lvhci 34G 13G 20G 39% /quovadx
/dev/VG00/lvol1 485M 8.1M 452M 2% /tmp
/dev/VG00/lvol2 2.9G 1.7G 1.1G 63% /usr
/dev/VG00/lvol3 4.9G 128M 4.5G 3% /var
/dev/cdrom 69M 69M 0 100% /mnt/cdrom
[root]#
 
Old 01-31-2007, 01:06 PM   #10
Dudydoo
Member
 
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275

Rep: Reputation: 38
Why not start at the basics and see if the kernel is recognizing all 4 drives?

Code:
dmesg | grep -E ^[sh]d[a-z]
 
Old 01-31-2007, 02:29 PM   #11
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Below are teh results from dmesg | grep -E ^[sh]d[a-z]
[root]# dmesg | grep -E ^[sh]d[a-z]
hda: DV-28E-N, ATAPI CD/DVD-ROM drive
hda: attached ide-cdrom driver.
hda: ATAPI 24X DVD-ROM drive, 256kB Cache, UDMA(33)
hda: DMA disabled
[root]#
 
Old 01-31-2007, 03:35 PM   #12
Dudydoo
Member
 
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275

Rep: Reputation: 38
Odd? It would appear that you only have a DVD-ROM drive attached. What type of drives have you got? PATA, SATA or SCSI?
 
Old 01-31-2007, 03:41 PM   #13
wdw66
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
The drives are 36.4 GB Ultra320 SCSI drives.
 
Old 02-01-2007, 01:35 AM   #14
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
dmesg | grep -E [sh]d[a-z]

or better
grep -E [sh]d[a-z] /var/log/*
 
Old 02-01-2007, 01:46 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,621

Rep: Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088
Better hope there's no repeated error message for the disk(s).
I once had thousands in everything, and messages, and kernel ...
 
  


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
How to find how much free space left on my hard disk? DataSheet Linux - Newbie 5 01-06-2007 10:35 PM
Other than top command which cmd is used to find the cpu usage and disk space sathish80 Linux - Newbie 2 11-15-2006 12:43 AM
Is there a way to find out where did all the hard disk space go? yinglcs Linux - General 4 02-28-2006 07:13 AM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 03:58 PM
How do i find out how much disk space i have Fathonkey Linux - General 5 06-07-2003 03:50 AM


All times are GMT -5. The time now is 11:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration