Linux File System Management

Source: Internet
Author: User

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

    • Role

Create a link.

    • Options

-s:soft, create a soft link.

Device files:

    • Role

The device file is the access entry for the hardware.

Mknod

    • Role

Create a device file. mknod [option] ... NAME TYPE [Major,minor]

    • Options

-M:

--mode=: Specifies the device file permission information.

Disk Management:

Du

    • Role

View disk usage for a file or directory.

    • Options

-H:

--human-readable: Improve the readability of information.

Df:

    • Role

View hard disk usage.

    • Options

-I.:

--inodes: Lists inode information.

Blkid

    • Role

Used to view disk device-related properties.

    • Content

Label: Volume label.

UUID: Unique identification.

Type: File system types.

Sec_type:

Fdisk

    • Role

View disk partition information and manage partition information.

    • Options

-L: Lists the disk partition tables.

    • Command

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:

    • Role

Notifies the kernel to reread the hard disk partition table.

/proc/partitions:

    • Role

Stores disk and partition information.

/proc/filesystems:

    • Role

The file system supported by the storage kernel.

Mkfs:make filesystem

    • Role

Create a file system.

    • Options

-T: Specifies the file system type. Mkfs-t ext2=mkfs.ext2.

MKE2FS:

    • Role

Create the Ext series file system.

    • Options

-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:

    • Role

View or define a volume label.

Tune2fs

    • Role

Adjusts the file system's related properties.

    • Options

-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:

    • Role

Displays file system-related information.

    • Options

-H: Displays only the Super block information.

Fsck:filesystem Check

    • Role

Check and repair the Linux file system.

    • Options

-T: Specifies the file system type.

-a:auto, automatic repair.

E2fsck

    • Role

Check and repair ext2, ext3 file system

    • Options

-f:force, forced detection.

-P: Auto fix.

Mount

    • Role

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.

    • Options

-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

    • Role

Uninstalls the specified file system.

When uninstalling:

The mounted device is not being used by the process.

Fuser:

    • Role

Validates the file or socket that the process is using.

    • Options

-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

    • Role

View current system physical memory and swap partition usage.

    • Options

-M: displayed in megabytes.

Mkswap:

    • Role

Creates a swap partition.

    • Options

-L: Specifies the volume label.

Swapon

    • Role

Enables swap partition swap space.

    • Options

-A: Enable all switching devices that are defined in the/etc/fstab file.

Swapoff:

    • Role

Close the swap partition.

Loopback Device:loopback, using software to emulate hardware implementation.

Dd:

    • Role

Copy the file.

DD If=xxx of=xxx

/dev/zero

    • Additional parameters

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.