In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the example analysis of disk and file system management in linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
= three important concepts =
* super block: record the overall information of the file system, including the total amount, usage and remaining amount of inode/block, as well as the file system format and related information.
* inode: record the attributes and permissions of a file. A file occupies an inode, and record the block number where the actual data (data) of the file is located.
* block: the actual recorded file content data will occupy multiple block if the file is too large.
Inode has 12 direct, 1 indirect, 1 double indirect, and 1 triple indirect block pointers.
# dumpe2fs / dev/sda2: lists the superblock information of the file system and the group information of all block.
= mount =
The mount point must be a directory, which is the entry into the file system
= disk and directory capacity =
# df [- hi] [directory or file name]-> list the disk usage of the entire file system
-h: readable display
-I: no hard disk capacity, but the number of inode display
# du [- hsS] file or directory name-> shows only the capacity of the file or directory
-h: readable display
-s: list the total capacity of the directory. Do not list the capacity details of the subdirectories under the directory.
-S: does not include statistics under subdirectories (not commonly used)
= to connect to the file ln====
Hard-connect hard link:
When using hard link to connect files, the number of block and the number of inode will not change. Hard link only writes an extra associated data in the block in a directory, which will neither increase the inode nor consume the number of block. Cannot cross file systems, cannot connect to directories.
Symbolic link symbolic link, that is, shortcuts:
Symbolic link is to create a separate file that will let the data read to point to the file name of the file to which he is connected. Will use one inode and at least one block
# ln [- sf] source target
-s: plus symbolic link symbolic link
-f: if the target exists, delete the target directly and then create it.
= disk Partition =
# fdisk [- l] device name
# fdisk / dev/sda, for the entire hard disk device, not for a partition.
= disk format =
# mkfs-t ext3 / dev/sda6
= check on disk =
# fsck-C-t ext3 / dev/sda1
# mount-o remount,rw,auto /
Re-mount the root directory in read-write form
= mount CD files =
# mount-o loop / root/centos5_dvd.iso / mnt/centos
This is the end of this article on "sample analysis of disk and file system management in linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.