(1) disk free (view disk usage and the location where the file system is mounted)
DF
Shown as follows:
File System 1 K-block used available % mount point
/Dev/sda2 2672264 2473244 63272 98%/
/Dev/sda1 101089 9233 86637 10%/boot
None 79012 0 79012 0%/dev/SHM
(2) disk usage (display space usage, including files and directory files)
Du-H directory name (h -- human readable)
Shown as follows:
8.0 K./. KDE/autostart
12 K./. KDE
4.0 K./. gnome2/accels
8.0 K./. gnome2/share/Fonts
8.0 K./. gnome2/share/cursor-Fonts
20 K./. gnome2/share
4.0 K./. gnome2/Nautilus-Scripts
28 K./. gnome2/panel2.d/default/launchers
32 K./. gnome2/panel2.d/Default
36 K./. gnome2/panel2.d
76 K./. gnome2
48 k./. pyinput
Du-SH Directory Name (s -- Summary)
Displays the total size of a directory.
(3) Partition
Fdisk-l view all disks
Shown as follows:
Disk/dev/SDA: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Device boot start end blocks ID system
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 351 2714985 83 Linux
/Dev/sda3 352 391 321300 82 Linux swap
Disk/dev/SDB: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk/dev/SDB doesn' t contain a valid Partition Table
Fdisk-L/dev/SDA view SDA disk Information
Partition operation:
Fdisk/dev/SDB
A toggle a bootable flag
B edit BSD disklabel
C toggle the DOS compatibility flag
* D delete a partition
L List known partition types
* M print this menu
* N Add a new partition
O create a new empty DOS partition table
* P print the Partition Table
Q quit without saving changes
S create a new empty sun disklabel
* T change a partition's System ID (Change partition type)
U change display/entry units
* V verify the Partition Table
* W write table to disk and exit
X extra functionality (experts only)
(4) Format
Mkfs. BFS mkfs. ext2 mkfs. JFS mkfs. msdos mkfs. vfatmkfs. cramfs mkfs. ext3 mkfs. minix mkfs. reiserfs mkfs. XFS and other commands to format partitions
For example, if you want to format sdb1 as an ext3 file system, enter it;
Mkfs. ext3/dev/sdb1
(5) mount a File System
Mount/dev/sdb1/mnt/sdb1
Umount/mnt/sdb1
But it will not be automatically mounted after the restart.
Edit file/etc/fstab
Add/dev/sdb1/OPT ext3 defaults 0 0