Df
viewing system partitions and usage
How to use:
Df-h (automatically according to the size of the unit to fit the display)
Df-i (view inode usage)
Free
View Swap partition Usage
Du
View the specified directory size (space-consuming size)
How to use:
Du-h/etc/(view/etc/directory size, including self-directory size)
Du-s/etc/(view/etc/directory or file size, not including subdirectory size)
FDISK (partitioning the disk)
How to use:
Fidsk-l (View the current partitioning situation)
fdisk/dev/sdb/(Partitioning the second disk)
Add hard disk, first block is SDA second block is SDB third block is SDC, etc.
The sum of the primary and extended partitions equals 4
Parted (partitioning of disks larger than 2T)
MKE2FS (formatted disk, adjustable reserved space)
MKFS.EXT4/DEV/SDB5 (format SDB5 partition as EXT4 format)
How to use:
Mke2fs-t ext4-b 1024-m 10-l study/dev/sdb1 (format/dev/sdb1, disk File system EXT4, block size 1024, reserve space size 10, label study)
Mounting the disk
Mount
mount points can only mount a disk, and then mount the cover off the front mount; you can use Umount to uninstall and restore the original data
Umount-l/mnt/(can be uninstalled without having to exit the current directory)
How to use:
mount/dev/sdb1/mnt/
Hang the SDB1 under the/mnt/mount point.
Mount Label=longfei/home/user1/123 (Attach the disk labeled LongFei to/home/user1/123)
Boot-on-mount
Blkid (see UUID and label for all mounted partitions)
If you want to power on and execute some commands to write the command to/etc/rc.local, the power on can be automatically executed.
Vi/etc/rc.local
Join Mount Dev/sdb2 (hang in partition)/mnt (mount point)
1, Vi/etc/fstab
To change the configuration file usage method
/DEV/SDB1 (to mount the partition)/mnt ext4 (file system) defaults (Mount option) 0 (whether to back up, 0 for no backup, 1 for backup) 0 (boot detection disk,/partition written 1, other partitions written in 2)
uuid (to mount partitions) /mnt EXT4 defaults (Mount option) whether to back up, 0 for no backup, 1 for backup ) &NBSP, 0 (whether the boot detection disk,/partition written in 1, Other partitions written in 2)
LABEL(to mount the partition)/mnt ext4(file system) defaults (Mount option) 0 ( whether backup, 0 for no backup, 1 for backup ) 0 (whether the boot detection disk,/partition written 1, other partitions written 2)
Defaults default options:
RW (Readable and writable)
Sudi (after this option, the partition can add S permission to the file, or write as Nosuid if not required)
Dev (can parse the file for block devices and character devices under this partition)
EXEC (Files under this partition have executable permissions)
Auto (can be directly powered on automatically mount)
Nouser (normal user is not able to mount the partition; If user, normal users can mount the partition)
Async (disk and memory out of sync; write as sync if you want to synchronize)
2, Mount-o (Mount also specify some options)
How to use:
mount-o noatim,rw/dev/sdb2 home/longfei1/123
Noatime (File not updated for Mount Partition Atime)
UUID: A method of identifying a partition available with the Mount command plus UUID mount partition
3. MOUNT-A (automatically load all configurations in configuration file)
How to use:
Mount-a
4. Mount (see which options are loaded on the Mount partition)
Disk mount and view under Linux