1. View the capacity of a disk or directory
DF View Disk partition usage
Df-i-h-m
Du view the amount of space a directory or file occupies
DU-A/tmp: Train full file and directory size
Du-c: Final Summary
2. Partitioning and formatting of disks
Fdisk-l viewing disks and partitions, greater than 2T with GPT
MKFS.EXT3, MKFS.EXT4, mke2fs-t EXT4 formatted partitions
Default Blocks (5.00%) reserved for the Super User # #给超级用户预留的空间, special purpose for formatting
-M can change this scale, such as Mke2fs-m 0.1/dev/sdb1 # #意思是只预留出0.1%
3. Mount and Unmount disk partitions
Mount does not have any options and parameters to see what is already mounted
mount/dev/sdb5/newdir/mount the/DEV/SDB5 to the/newdir directory, dmesg|tail view the error message if the mount fails Umount/newdir
4. configuration file/etc/fstab
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/9B/wKiom1UeJWOTcGC_AAI-OLiwIpk434.jpg "title=" 2.png " alt= "Wkiom1uejwotcgc_aai-oliwipk434.jpg"/>
The first column is the identity of the partition, the label or UUID or the partition name of the partition can be written, the second column is the mount point, the third column is the partition format, the fourth column is a number of mount parameters, usually directly write defaults, the number of the fifth column indicates whether the dump backup, 1 is 0 no The sixth column indicates whether a self-test disk is turned on, 1, 2 for self-test, 0 not self-checking, 1 for high priority,/partition must be 1.
The parameter of the fourth row mount: ' Auto/noauto ' automatically mount the boot or not
"Async/sync": Async disk and memory out of sync, the system writes memory data to disk at intervals, sync synchronizes in real time
"Default": sets the mount definition according to the default values of most file systems, including Rw,suid,dev,exec,auto,nouser,async
"Ro": Mount by read-only permission; "RW": Mount according to read and write permission;
"Exec/noexec": Allow/not allow executable file execution, but must not mount the root partition as noexec, so it can not be started, can only redo the system
"User/nouser": Allow/Do not allow other users to mount the partition outside the root, for security reasons, general use Nouser
"Suid/nosuid": Allow/Disallow partitioning with SUID properties, general settings Nosuid
"Usrquota": Start consumer disk quota mode
"Grquota": Start the group disk quota mode
After you modify/etc/fstab add label=test Add in, use Mount-a to mount.
Blkid viewing the UUID of each partition
Create a swap file to increase virtual memory
#dd if=/dev/zero of=/tmp/newdisk bs=4k count=102400 partition target file size: Bs*count
#mkswap-F/tmp/newdisk
#free-M
#swapon/tmp/newdisk
#free-M
This article is from the "Rhythm" blog, make sure to keep this source http://rhythm.blog.51cto.com/2800158/1628058
2015.3.23 Linux under Disk Management