File Special permissions:
SUID: When running a program, the owner of the corresponding process is the owner of the program file itself, not the initiator.
chmod u+s File: If file itself has execute permission, the suid is displayed as s; otherwise it is displayed as S.
chmod u-s FILE:
SGID: When you run a program, the owning group of the corresponding process is the genus of the program file itself, not the initiator group.
chmod g+s FILE:
chmod g-s FILE:
Sticky: In a common directory, each user can create files, delete their own files, but cannot delete others ' files.
chmod o+t DIR:
chmod o-t DIR:
Facl:filesystem Access Control List
Use file extensions to save additional access control permissions.
Setfacl:
-M: Sets the additional access control list.
U:uid:perm
G:gid:perm
D:u:uid:perm: The default Access control list that is set on the directory.
D:g:gid:perm: The default Access control list that is set on the directory.
-X: Cancels the additional access control list.
U:uid
G:gid
--mask:
Getfacl:
Disk:
Platter:
Head:
Track:
Sector:
Cylindrical Surface:
Mbr:master boot record, master boot recording, 512byte. where 446byte storage bootloader program, 64byte in each 16byte identifies a partition, 2byte store magic number, used to mark the MBR is valid.
Partition:
Primary partition:
Extended partition:
Logical partition:
Boot blocks: Boot block.
Log area:
Block groups:
Super blocks: Super block.
Block Group Descriptor: Gdt,group Description table.
Block bitmap: Block bitmap.
Node bitmap: Inode bitmap.
Inode table:
Data BLOCK:
Vfs:virtual FileSystem
Virtual file system.
File system:
FAT32, NTFS, ISO9660, CIFS, Ext2, ext3, Ext4, swap, XFS, ReiserFS, JFS, NFS, OCFS2, GFS2
Mount: Associates a new file system to the current file system.
Uninstall: removes a file system from the associated relationship of the current root file system.
Virtual Address:
Swap partition:
Link:
Soft connection: Can be applied to the directory, can cross the file system, does not increase the number of links to the linked file, and its size is the number of characters that the specified path contains.
Hard links: Only files can be created, cannot be applied to directories, cannot span file systems, and creating hard links increases the number of times a file is hard-linked.
ln
Create a link.
-s:soft, create a soft link.
Device files:
The device file is the access entry for the hardware.
Mknod
Create a device file. mknod [option] ... NAME TYPE [Major,minor]
-M:
--mode=: Specifies the device file permission information.
Disk Management:
Du
View disk usage for a file or directory.
-H:
--human-readable: Improve the readability of information.
Df:
View hard disk usage.
-I.:
--inodes: Lists inode information.
Blkid
Used to view disk device-related properties.
Label: Volume label.
UUID: Unique identification.
Type: File system types.
Sec_type:
Fdisk
View disk partition information and manage partition information.
-L: Lists the disk partition tables.
P:print, displays the partitions of the current hardware, including changes that have not been saved.
N: Creates a new partition.
e:extended, extended partition.
P:primary, primary partition.
D: Delete a partition.
W: Save exit.
Q: Do not save exit.
T: Modify the partition type.
L: Displays all supported types.
PARTPROBE/PARTX:
Notifies the kernel to reread the hard disk partition table.
/proc/partitions:
Stores disk and partition information.
/proc/filesystems:
The file system supported by the storage kernel.
Mkfs:make filesystem
Create a file system.
-T: Specifies the file system type. Mkfs-t ext2=mkfs.ext2.
MKE2FS:
Create the Ext series file system.
-j: Create the Ext3 file system.
-B: Specifies the block size.
-l:label, specify the partition volume label.
-M: Specifies the percentage of blocks reserved for super users.
-I: Specifies the number of bytes of space to create an inode, the default is 8192; The value given here should be 2^n times the block size.
-N: Specifies the number of inode created.
-F: Forces the file system to be created.
-E: Used to specify additional file system properties.
E2label:
View or define a volume label.
Tune2fs
Adjusts the file system's related properties.
-j: The ext2 is upgraded to ext3 without compromising the original data.
-L: Used to set the volume label.
-M: Adjusts the reserved percentage.
-r: Specifies the number of reserved blocks.
-O: Sets the Mount property.
-C: Specifies that the number of mounts to be self-test after a specified number of times, 0 or 1 means to turn off this feature.
-I: Specifies how many days to self-test, 0 or 1 To turn this feature off.
-L: Displays the Super block information.
DUMPE2FS:
Displays file system-related information.
-H: Displays only the Super block information.
Fsck:filesystem Check
Check and repair the Linux file system.
-T: Specifies the file system type.
-a:auto, automatic repair.
E2fsck
Check and repair ext2, ext3 file system
-f:force, forced detection.
-P: Auto fix.
Mount
Mount the file system to the specified directory.
Device file:/dev/sda5
Volume Label: label= ""
Uuid:uuid= ""
Mount point directory:
This directory is not being used by another process.
Directories have to exist beforehand.
The original files in the directory will be temporarily hidden.
-A: Indicates that all file systems defined in the/etc/fstab file are mounted.
-N: By default, the Mount command does not mount a device, it saves the mounted device information to the/etc/mtab file, and the-N option means that the file system is mounted without writing the information to the file.
-T: Specifies the type of file system on which the device is being mounted; Without this option, Mount invokes the Blkid command to obtain the type of the corresponding file system.
-r: Mount the file system as read-only.
-W: Mount file system for read-write.
-O: Specifies the additional mount option, which specifies the properties that the file system enables.
Async: Writes asynchronously.
Atime: The timestamp is updated every time it is accessed.
Remount: Re-mount the current file system.
RO: Mount as read-only.
RW: Mount for read-write.
Loop: Mount the local loopback device.
Umount
Uninstalls the specified file system.
When uninstalling:
The mounted device is not being used by the process.
Fuser:
Validates the file or socket that the process is using.
-V: View the processes that are being used on a file.
-K: Terminates all processes that are accessing the specified file.
-M: Specifies the mounted file system.
Memory Management:
Free
View current system physical memory and swap partition usage.
-M: displayed in megabytes.
Mkswap:
Creates a swap partition.
-L: Specifies the volume label.
Swapon
Enables swap partition swap space.
-A: Enable all switching devices that are defined in the/etc/fstab file.
Swapoff:
Close the swap partition.
Loopback Device:loopback, using software to emulate hardware implementation.
Dd:
Copy the file.
DD If=xxx of=xxx
/dev/zero
Bs:block size.
Count
Seek: Skips the number of blocks.
/etc/fstab: File System configuration file
- Mounting devices
- Mount point
- File system type
- Mount Options
- Dump frequency, make a full backup every few days
- File system detection order, only root is 1
Linux File System Management