Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux Hard Disk Partition and file system management     - Difference Docker mirror and containers (Server)

- RabbitMQ installation, configuration, monitoring (Linux)

- Struts2 study notes -Valuestack (value stack) and OGNL expression (Programming)

- Zabbix installation and configuration process (Server)

- How to enable curl command HTTP2 support (Linux)

- IDS Intrusion Detection System built (Linux) (Linux)

- Oracle 10g after the failure to start the upgrade (Oracle instance terminated. Disconnection forced) (Database)

- Java Generics (Programming)

- C ++ thread creates transmission parameters are changed (Programming)

- CoreCLR compiled in Linux CentOS (Linux)

- Oracle 11g RMAN cross-platform transfer table space (Database)

- CentOS 6.2 install git error Perl5 (Linux)

- Nginx Beginner Guide (Server)

- How to disable UEFI to install Linux on Win8 (Linux)

- MySQL log from the library than the main library (Database)

- How to cool down your Ubuntu system (Linux)

- Fatal: unable to connect to github.com problem solving (Linux)

- Crawl use Wireshark packet on remote Linux (Linux)

- Linux remote wake the computer original code [C] (Linux)

- Nginx load balancing configuration (http proxy) (Server)

 
         
  Linux Hard Disk Partition and file system management
     
  Add Date : 2018-11-21      
         
         
         
  File System Key: inode (index node), block (logical block), superblock (the start of each file system location that block, such as the size of the file system for storing, empty or filled block, and it is the total number of the respective information, etc.)

Physical disk consists of:
Circular disk plate
Mechanical arm, mechanical arm and on disk read heads (rewritable disk data on the disc)
Spindle motor, you can rotate the disk drive, so that the mechanical arm of the read head to read and write data on the disk tray

Physical disks that comprise the disk:
Sector (sector) for the smallest physical storage units, each sector is 512bytes
The sectors of a circle, that is, cylinders, cylinders are the smallest unit of partition
The first sector is the most important, there are mbr (master boot area) and the partition table, which mbr possession 446bytes, and the partition table is occupied 64bytes

Disk partition: partition specified start and end cylinders

Range partitioning cylinders recorded in the first sector of the partition table

Inode: storing permissions and attributes are:

 - the owner and group of the file (owner / group);

 - The file access mode (read / write / excute);

 - The file type (type);

 - The file was created or the status change time (ctime), nearly a read time (atime), near-modified time (mtime);

 - the capacity of the archives;

 - definition file feature flag (flag), as SetUID ...;

 - The actual contents of files point (pointer);

Data block: store the actual data
Superblock: General information recorded the entire file system, including the total amount of usage, and the remaining amount inode block, etc.

Since the index is ext2 file system, usually you do not need to defragment often

If the hard disk file system up to hundreds of gb, all inode and block all put together would be very unwise decision, since the number of inode and block too big, not easy to manage; therefore ext2 file system format when basic the group is divided into a plurality of blocks (block group), each group of blocks has its own inode / block / superblock system

A file system has only a superblock; in addition contain superblock within the first block group, block group necessarily contains subsequent superblock, and if they contain the superblock superblock primarily as the first block group within the superblock backup, you can superblock rescue

Dumpe2fs / dev / hda2: View hda2 partition is superblock information

Directory not only occupy a block of it, that is to say: the number of files under the directory if too many cause a block can not accommodate all the file names and inode table when, linux directory that will give one more block to continue to record off data

If the file is too discrete data can be copied all the files within the system out, and then reformat the file system, go back and repeat that data replication can solve the problem

Log File System: ext3:
Start: When the system is to be written to a file, the logging will now block the recording of a file ready to be written information
Actual write: permission to start writing at the time of the data; start the update metadata data
Ending: After completing the data field metadata updates, complete record of the file in which logging block
When the file system appears inconsistent, the system just go check the log block, you can find an exception file, and then you can check for consistency of the file, without having to check for monolithic filesystem, achieve rapid repair filesystem Ability

Common file system support are:
Traditional file systems: ext2, mimix, ms-dos, fat (with vfat module), iso9660 (CD-ROM), etc.
Log File System: ext3, reiserfs, windows'sntfs, ibm's jfs, sgi's xfs
Network File System: nfs, smbfs

Linux standard file system is ext2

See linux Supported file systems: ll / lib / modules / $ (uname -r) / kernel / fs

View the system has been loaded into memory Supported file systems: cat / proc / filesystems

Hard link (not cross filesystem, can not link directories): to generate a new file name by inode link to the file system, instead of generating a new file
Soft Link: is a shortcut under windows

Linked file: Ln [-sf] source target file

Linux after repartitioning, you may require a reboot to update the core of the partition table; without restarting, can also be performed using the following command: partprobe; partprobe vocational core role is necessary to read the new partition table only

When the hard disk partition, preferably in single-person maintenance mode relatively safer; during fdisk time, if a partition of the hard disk is still with them, it is likely that the core can not overload the system hard disk partition table, resolve the method is to use the beloved that the partition to dismount, and then re-enter the fdisk again, re-write partition table, you can succeed

Subdivision: fdisk

Fdisk can not handle more than one disk partition larger than 2tb! Although ext3 file system support has reached more than 16tb disk, but can not support the split instruction; at this time need to use parted instruction

Disk format: mkfs
Mkfs -t ext3 / dev / hda3: the / dev / hda3 ext3 formatted with a file system
Vfat can be used in windows / linux shared u disk

Disk Test: fsck, badblocks

Fsck -C -f -t ext3 / dev / hdc6: Test Disk / dev / hdc6
-C: Display progress
-f: Force checking
-t: Specifies the file system format

Fsck is used to check and correcting file system errors instruction. Note: usually only as a root file system and you have a problem, when it is using this instruction, otherwise use this command in normal circumstances, may cause harm to the system! Usually use this directive are occasions there is a great problem in the system, resulting in the linux boot time you got to go to the single stand-alone mode for maintenance behavior only when you must use this command

If you suspect a problem with just formatted the hard disk, you can use fsck to check the hard drive! Furthermore, since fsck scanning the hard disk, it may cause damage to the part of the filesystem, so the implementation of fsck, be sure to check the partition can not be mounted on the system! That is required in the dismounted state

Lost + found: This directory is in when you use fsck to check the file system, if there is a problem, the problem of data will be placed in the directory! In theory this should not have any data directory

Badblocks: used to check the hard disk or floppy disk sector there is no bad track instruction
Badblocks -svw / dev / hda3
-s: Lists progress on screen
-v: you can see on the screen to enter
-w: to use the written test mode, it is recommended not to use this parameter, especially a device has to be examined when the file

Directory Linux supported file system drivers are: /lib/modules/2.6.18-238.el5/kernel/fs

Mount: Mount (Example :)
Mount / dev / hdc6 / mnt / hdc6
Mount -t iso9660 / dev / cdrom / media / cdrom
Mount -t vfat -o iocharset = cp950 / dev / sda1 / mnt / flash
Mount -o loop test.iso / mnt / dvd (later mount iso, iso files can be modified; this is why a lot of post-iso file provides, have to provide verification code (md5) iso file to the user to confirm there is no problem )

If you mount the parameter to be changed, or when the root directory read-only state occurs, how to re-mount it? The most likely approach is to restart; in addition you can also do this:
The / remount, rw and add parameters and auto
mount -o remount, rw, auto /
Focus is on the -oremount, xx options and parameters! Please note that, to remount, this is a very important mechanism! Especially when you enter the single maintenance mode, you are often the root of the system will be mounted read-only bit, this time the instruction is too important

Umount: Uninstall
Umount -fn device file name or mount point
-f: Force dismount! Available in cases like the network file system (nfs) can not be read to
-n: Do not update under / etc / mtab situation dismount

Dumpe2fs -h / dev / hdc6: View Partition Information

Boot mount: / etc / fstab configuration file entries:
disk device file name or label of the device
Mount points
Disk partition file system
File System Parameters
It can be dump backup command role
Whether fsck inspection sector

Extended swap partition:
1. Split: first use fdisk partition on the disk to the system as a carved swap. Since fdisk will default partition id is set for linux linux file system, we need to set about system id
2. Format: Using the established format mkswap swap device file name, you can format the partition becomes swap format
Mkswap / dev / hda4
3. Use: Finally, the swap device is activated, the method is: swapon device file name
Swapon / dev / hda4
4. Observation: The final free through this command to look at the amount of memory it

Use file Build swap:
1. dd if = / dev / zero of = / home / swapbs = 1M count = 512
2. mkswap / home / swap
3. swapon / home / swap | swapoff / home / swap

superblock size 1024bytes
Front superblock need to keep 1024bytes down to make the boot manager can be installed

parted (for more than 2t hard disk partition):
parted / dev / hda print: view the partition
parted / dev / had mkpart logical ext3 19.2G 19.7G: the establishment of a logical partition
parted / dev / had rm 8: Deleting a partition

inode bitmap: inode table (inode total, the amount of use, the remaining amount)
inode table: inode table (inode point block)

Boot automatically mount refer to / etc / fstab of the set, the set is finished be sure to use mount -a test whether the correct syntax
     
         
         
         
  More:      
 
- CentOS 7 How to install MySQL Server (Database)
- The callback function used in C ++ (Programming)
- Achieve single backup of MySQL by innobackupex (Database)
- CentOS How to mount the hard drive (Linux)
- CentOS / Linux restart active NIC connection paths / network configure error Error Resolution (Linux)
- BusyBox making the file system (Linux)
- Vi / Vim prompt solutions do not have permission to save time (Linux)
- These days have been tossing in the Linux under the ASP.NET 5, on the next in the other operating systems in the ASP.NET 5 or. NET applications, in order to complete the MS VM (CoreCLR) run is not far Reach, the effect of the application.

Cur
(Server)
- Customize the output format in Linux history (Linux)
- CentOS and RHEL to install IPython 0.11 (Linux)
- How ONLYOFFICE collaborative editing document on Linux (Linux)
- Oracle 11g RMAN cross-platform transfer table space (Database)
- How to configure SNMPv3 on Ubuntu, CentOS and Cisco systems (Linux)
- RMAN parameters of ARCHIVELOG DELETION (Database)
- Linux smart small switch rfkill (Linux)
- How to upgrade the kernel to 3.13.7 on Ubuntu / Linux Mint (Linux)
- Oracle table space is too large processing time (Database)
- Vagrant build LNMP environment (Server)
- RHEL6.4 x86_64 build SVN service (Server)
- Linux operating system to solve a serious fault handling (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.