Search This Blog

Monday, March 10, 2008

How to find out or Learn harddisk size in Linux or UNIX

Q. How do I find out or learn hard disk size in Linux? A. Under Linux and UNIX you can use df command. df command displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown. Task: Display hard disk partition size $ df Output: Filesystem 1K-blocks Used Available Use% Mounted on /dev/hdb1 19228276 14699744 3551784 81% / tmpfs 384300 4 384296 1% /dev/shm /dev/hdb5 27917308 23883184 2615988 91% /data/network Task: Display hard disk partition size in Mega bytes $ df -H Output: Filesystem Size Used Avail Use% Mounted on /dev/hdb1 20G 16G 3.7G 81% / tmpfs 394M 4.1k 394M 1% /dev/shm /dev/hdb5 29G 25G 2.7G 91% /data/network Task: Display TOTAL hard disk size fdisk command is partition table manipulator for Linux. But it can be use to display total hard disk site. You must type the following command as the root user: # fdisk -l | grep Disk Output: Disk /dev/hda: 20.0 GB, 20060651520 bytes Disk /dev/hdb: 80.0 GB, 80060424192 bytes

No comments: