[Linux] Linux file system learning

Source: Internet
Author: User
Tags uuid

Linux systems support a wide variety of file systems.

1. How can I confirm which file systems are attached to the current system?
Use the Mount command to see which file systems are already mounted on the current system.

[Email protected]:~$ Mount
/DEV/SDA1 On/type Ext4 (rw,errors=remount-ro) proc on/proc Type proc (rw,noexec,nosuid,nodev) Sysfs on/sys type SYSFS (rw,noexec,nosuid,nodev) None on/sys/fs/fuse/Connections Type Fusectl (rw) None on/sys/kernel/Debug Type Debugfs (rw) None on/sys/kernel/Security Type SECURITYFS (rw) udev on/dev Type Devtmpfs (rw,mode=0755) devpts on/dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) Tmpfs on/run type TMPFS (rw,noexec,nosuid,size=10%,mode=0755) None on/run/lock type TMPFS (rw,noexec,nosuid,nodev,size=5242880) None on/run/SHM type TMPFS (Rw,nosuid,nodev) Binfmt_misc on/proc/sys/fs/binfmt_misc type Binfmt_misc (Rw,noexec,nosuid,nodev)

You can also view the file system on the current system in real time with the following command

[Email protected]:~$ cat/proc/Mountsrootfs/rootfs RW 0 0Sysfs/sys Sysfs rw,nosuid,nodev,noexec,relatime 0 0proc/PROC proc Rw,nosuid,nodev,noexec,relatime 0 0Udev/dev Devtmpfs rw,relatime,size=4022676k,nr_inodes=1005669,mode=755 0 0devpts/dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0Tmpfs/run tmpfs rw,nosuid,relatime,size=1612588k,mode=755 0 0/dev/disk/by-uuid/f38fd44a-b1b5-4636-970e-826dba3c398d/ Ext4 rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered 0 0None/sys/fs/fuse/connections fusectl rw,relatime 0 0None/sys/kernel/debug Debugfs rw,relatime 0 0None/sys/kernel/security SECURITYFS rw,relatime 0 0None/run/lock Tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0None/run/shm Tmpfs rw,nosuid,nodev,relatime 0 0Binfmt_misc/proc/sys/fs/binfmt_misc Binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0

2. Linux ext2 file system?
The ext2 file system partition consists of two parts, the Inode and the block,
The inode is used to store the file's attribute information, while the block area is used to store the actual file contents.
For this reason, there may be two more extreme situations:
The size of the files on the disk is small, causing the inode on the disk to be exhausted, but the block area still has a large amount of surplus resulting in wasted disk space;
The size of the files on the disk is large, resulting in a small number of files on the disk and the block area is exhausted, resulting in a waste of inode space.
Ext2 file system due to the lack of log system, thereby causing inconvenience to the system management, so in the Ext3 file system added the log system, namely:
ext3 = ext2 + Log system

3. A note on the inode?
Under normal circumstances, an inode corresponds to a file.
However, due to the existence of a hard connection (a hard link is an inode, but there are multiple copies of the file content in the block), there are exceptions.
Formal inode and block partitioning, which makes it possible to create hard links and soft connections for files.
In addition, the INODE structure does not contain file name information.

4. VFS?
Linux provides VFS, which makes application programming easier because applications don't have to consider the differences between different file systems.

5. Why move quickly in the same filesystem and move slowly in different file systems?
Since copy in the same file system does not need to move the data area in the block area, only the inode information needs to be modified;
In the different file system move, not only to modify the Inode information, and the block area stored in the file information must also be
Copy to another file system.

6. pseudo file system?
A pseudo file system is a file system that is created from memory. Once the system loses power, the contents of the file system are lost.

7. How can I view the usage of the file system?
(1) using the DF command can help us to achieve this demand,

[Email protected]:~$ DF-hfilesystem      Size  used Availuse% mountedon/dev/sda1       458G  122G  314G  28%/udev            3.9G  4.0K  3.9G   1%/devtmpfs           1.6G  1.1M  1.6G   1%/runnone            5.0M     0  5.0M   0%/run/locknone            3.9G  472K  3.9G   1%/RUN/SHM

(2) Use the Stat command to view and use the-F option to view the file system information for the specified file.

[Email protected]:~$ stat/dev  File: '/dev'  size:4360          blocks:0          IO block:4096 c7/>directorydevice:5h/5d    inode:1025        links:16Access: (0755/drwxr-xr-x)  Uid: (    0/    Root)   Gid: (    0/    2014-08-06 17:58:17.344020754 +08002014-08-06 12:00:37.641852226 +08002014-08-06 12:00:37.641852226 +0800-

8. How can I confirm which file systems are supported in the current system?
Use Cat/proc/filesystems to view,
The first column of Nodev indicates that the type file does not need to be mounted on a block device, otherwise it needs to be hung on a block device;
The second column represents the file system types supported in the current system.

[Email protected]:~$ cat/proc/filesystems nodev    sysfsnodev    rootfsnodev    bdevnodev    Procnodev    cgroupnodev    cpusetnodev    tmpfsnodev    devtmpfsnodev    debugfsnodev    securityfsnodev    Sockfsnodev    pipefsnodev    anon_inodefsnodev    devpts    ext3    ext4nodev    ramfsnodev    Hugetlbfsnodev    ecryptfs    fuseblknodev    fusenodev    fusectlnodev    pstorenodev    Mqueuenodev    binfmt_misc    vfat

9. How do I load a file system?
Method One: Since the system starts by reading the/etc/fstab to configure those fixed file system, so for those
Requires a fixed loading of the file system, we can be configured in the/etc/fstab;
Method Two: After the system starts, according to the need, self-loading file system.

[Email protected]:~$ cat/etc/fstab#/etc/fstab:Staticfile system information.## use' Blkid ' to print the universally unique identifier fora# device; ThisMay is used with uuid=As a more robust-to- name devices# that works evenifDisks is added and removed. See Fstab (5).## <file system> <mount point> <type> <options> <dump> <pass>proc/PROC proc Nodev,noexec,nosuid 0 0# /was on/dev/sda1 during Installationuuid=F38FD44A-B1B5-4636-970E-826DBA3C398D/EXT4 Errors=remount-ro 0 1# swap is on/dev/Sda5 during Installationuuid=E60359F1-99EF-4B52-B081-F76F90E590FB None swap SW 0 0None/tmp_fs Tmpfs Nodev 0 0

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.