22. Self-Learning Linux path: File system, partitioning, formatting

Source: Internet
Author: User
Tags uuid

Access by name is a primary purpose of file system existence
is a software that manages binary binaries that exist on disk
In order to be able to install multiple systems on one disk, the concept of partitioning was introduced
Track: The tracks are well-divided by the manufacturer
Sector: Sector
equipment with fixed angular velocity
Any sector on any disk, the average time read is called the average seek time
Cylindrical Surface:
Partition:
The No. 0 sector stores the partition information of the disk,
Mbr:master boot record Master boot records
512byte:
Bootloader: Recording device, 446bytes
Boot a partition every 16 bytes,
2 bytes are populated with 2 5a,mbr validity tags
4 Primary partitions
Extended partitions, referencing other additional partition tables
Logical Partitioning
GPT: Technology that is larger than 2TB
HDD: storage location/dev

HDD Interface:
IDE (ATA): Two drives per controller, MASTER/SLAVE,133MB/S
/DEV/HD[A-Z]
/DEV//HDA[1-4]
Logical Partition 5 Start
/dev/hda[5+]
Scsi:small computer System Interface Small Computer interface
320mb/s
SATA (Serial): 300mbps,600mbps,6gbps
sas:6gbps

Dma:direct Memory Access


Fdisk Sfdisk parted

Vfs:
File system:
Basic file System: EXT3,EXT3,EXT4,REISERFS,XFS (supports a single huge file), Jfs,vfat,ntfs
Swap partition: Swap
Cluster file system: GFS2,OCFS2
Network File System: NFS,SMBFS (Window is CIFS)
Disc: iso9660

Raw
Fdisk
D Delete Partition
N: Create a new partition
P: List existing partitions
T: adjust to partition ID
L: List kernel-supported partition IDs
W: Save exit
Q: Do not save exit
M: Help
Centos5:partprobe
Centos6:partx Kpartx
Kpartx-l/DEV/SDA
Kpartx-af/dev/sda
Partx-a/DEV/SDA
MKFS: Used to format
-T File system: Specifies the file system to format the partition later
Mke2fs-t

Ext4:mkfs-t Ext4 = MKFS.EXT4 = Mke2fs-t Ext4
EXT3 (log file system): mkfs-t ext3 = MKFS.EXT3 = mke2fs-t ext3 = mke2fs-j

MKE2FS:
Configuration file:/etc/mke2fs.conf
-T: Specify file type
-j:
-L Label: Specifies the volume label,
-b{1024|2028|4096}: Specify block size
-I #: #个字节给指定一个indone
-N #: Specify how many Indone to reserve directly
-I #: Specify Inode size
-M #: Percentage of space reserved for administrators, default is 5
-o: Specify partition attributes
E2label/dev/somedevice View the volume label,
E2label/dev/somedevice label directly change the volume label

Blkid viewing UUID and type

DUMPE2FS View Super blocks and whether there are fragments
-H: Show only information saved in the Super block
TUNE2FS: Adjusting the MKE2FS information
-L: View information in the Super block
-L: Set the volume label
-m: Percentage of space reserved for administrators
-j: If the original file system is ext2,-j, it can be promoted to ext3
-o:[^]mount-options[,...] Specify default mount options
-o:[^]feature[,...] Adjust partition properties
Tune2fs-o mount option Device
Tune2fs-o ^ Device option Cancel
FSCK: File System detection
-T file type device
-F Force Detection
-A auto Fix error
-R Interactive Fix error
E2fsck-t Specified time
-Y Auto Answer Yes
-F Force Detection


Swap partition:
Virtual memory
Mkswap formatted as virtual memory
-L label Specifies the volume label
Swapon Starting virtual memory
-A start all virtual partitions
-P: Specify priority
Swapoff shutting down virtual memory


Gpt
Ssds

Partition: Fdisk
Formatting: Creating a file system

Get information about an IDE disk
Hdparm
-I reads from the operating system
-I read directly from the hard drive
-G Displays the layout information of the hard disk
-T Test Drive performance
-T Test Drive performance

/proc/partitions
/proc/meminfo
Types of file systems for nuclear energy identification in/proc/filesystems

Mount:
Manual mount
Mount on Demand
Auto mount on Boot

Mount[options]-t file type-o option device mount point
[Options]: Option for commands
-N: Do not update the/etc/mtab file
--bind:dir1 Dir2 mount the directory to the directory, allowing Dir2 to access Dir1 files
-T Fstype
-R Read-only mount
-W: Read-write Mount
-L lable is specified as a volume label, or you can use lable= "lable"
-U uuid: Mount with UUID or use uuid= "UUID"
-O options: Start partition feature when mounted
Async: Asynchronous I/O
Sync: synchronous I/O
Noatime/atime whether to update file timestamps, not particularly important files, recommended Noatime
Auto: Is it possible to automatically mount all files (/etc/fstab) automatically by mount-a
Dev/nodev: Can I create a device file
Diratime/nodirtime: Whether to update the timestamp of the directory
Exec/noexec: Whether to allow binary program execution
_netdev: Network Equipment
Remount: Re-mount
Relatime/norelatime is updated in real time
ACL File access Control List

Mount point: The original data will be hidden after mounting
1. Select the free directory
2. Must exist beforehand
Unloading:
1, can be unloaded when idle
Umount Equipment | mount point

Use mount directly to display the current system's mount information, or to view/proc/mounts or/etc/mtab


Disc:
/dev/cdrom/dev/dvdrom/dev/sr0
[-T iso9660]

To view the process of owning a mounted device
Fuser-v mount point
fuser-km mount point force culling shell process

DF Disk space Usage Status report
-H: Display easy-to-read information
-I: Display Indoen
-P: Show All
Du shows how a file occupies a disk
-S: Entire Directory size

Auto mount on Boot
/etc/rc.d/rc.sysinit: System Initialization script
One of the features: mount a file system mount point defined in the/etc/fstab file
/DEV/MAPPER/VG0-ROOT/EXT4 Defaults 1 1
Uuid=58894bb8-5b23-4f00-baff-0c19d450bfe9/boot EXT4 Defaults 1 2
/DEV/MAPPER/VG0-USR/USR EXT4 Defaults 1 2
/dev/mapper/vg0-var/var EXT4 Defaults 1 2
/dev/mapper/vg0-swap swap swap defaults 0 0
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
Devices to mount: device files, label= "Ladel" UUID
Mount point: Some file system does not have mount point swap no mount point, mount point is swap
File system type:
Mount options: Use commas to separate multiple options
Dump frequency:
0: Never Back up
1: Daily backup
2: Backup every other day
Self-Test order
1: First self-test, usually can only be/used
2-9: Order
0: Never self-checking


Swap partition:
Linux uses memory mechanism:/proc/sys/vm/swapiness

How big is good:
Greater than 2G, less than 4G =4g
Less than 2G =2* physical memory
8g+:=4g
View memory space usage status
Cat/proc/meninfo
Free
-M: Display results in megabytes
-G: Display results in gigabytes
DD Command:
BS: How much data to read at one time
Count: Number of Reads
if: Input file
Of: Output file
DD If=input_file Of=output_file
DD if=input_file of=output_file Bs=#[b|k|m|g] count=#
Cat/dev/cdrom >/tmp/linux.iso Making Discs

/dev/zero: Spit 01


File link
ln source file Destination file
Hard Links:
Cannot span partitions,
Two locations pointing to the same indone
Cannot create a hard link to a directory
Hard links change the number of times a file is linked
Symbolic Links:
Ln-s
Symbolic links can span partitions
The symbolic link file differs from the source file with an inode
You can create symbolic links to a table of contents
Symbolic links do not change the number of times the source file is linked


Dev first represents the primary device number second represents the secondary device number

Compression tools
Zip:
gzip:gunzip= Gzip-d,zcat
Suffix:. gz
-c Specifies the file to compress
Bzip2,bunzip2
-K Preserve Source files
Suffix. BZ
Xz
Suffix. xz
-#: Specifies a compression ratio of 1-9, the default is 6


Archive tool:
tar [options] File.tar file1 ....
-C: Create an archive
-X: Expand Archive
-T: Directly view archived files without expanding
-Z: Using gzip compression
-J: Using bz2 compression
-J: Using XZ compression

22. Self-Learning Linux path: File system, partitioning, formatting

Related Article

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.