永发信息网

如何查看linux super block

答案:2  悬赏:20  手机版
解决时间 2021-03-10 22:27
如何查看linux super block
最佳答案
想要一看linux的超级块全貌,首先你必须得知道超级块(superblock)寄宿在哪个设备上。
先查看一下我们的设备:
root@xiahuixia-Inspiron-3437:/home/xiahuixia/tmp# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 476559384 13315584 439012940 3% /
none 4 0 4 0% /sys/fs/cgroup
udev 1964312 4 1964308 1% /dev
tmpfs 395000 1360 393640 1% /run
none 5120 0 5120 0% /run/lock
none 1974984 17240 1957744 1% /run/shm
none 102400 36 102364 1% /run/user
root@xiahuixia-Inspiron-3437:/home/xiahuixia/tmp#

ok, 有一个设备叫做/dev/sda1,是的,它就是我的硬盘了,我没有把我的硬盘分区,所以只有一个/dev/sda1 ,没有/dev/sda2 、/dev/sda3….
然后查看一下这个命令“dumpe2fs”(dump ext2 file system , ext2文件系统是linux的正规文件系统)

DUMPE2FS(8) System Manager's Manual DUMPE2FS(8)
NAME
dumpe2fs - dump ext2/ext3/ext4 filesystem information
SYNOPSIS
dumpe2fs [ -bfhixV ] [ -o superblock=superblock ] [ -o blocksize=block‐ size ] device
DESCRIPTION
dumpe2fs prints the super block and blocks group information for the filesystem present on device.
Note: When used with a mounted filesystem, the printed information may be old or inconsistent.
OPTIONS
-b print the blocks which are reserved as bad in the filesystem.
-o superblock=superblock
use the block superblock when examining the filesystem.This option is not usually needed except by a filesystem wizard who is examining the remains of a very badly corrupted filesystem.

至于man手册开头的DUMPE2FS(8), 8是什么意思呢?
再执行man man 看一下:
The table below shows the section numbers of the manual followed by the types of pages they contain.
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
A manual page consists of several sections.

看到了吗? 8 System administration commands (usually only for root)
好了,回到命令dumpe2fs来,dumpe2fs dev, 那么,这个dev该用什么来代替呢?就是我们的设备/dev/sda1了。

好了,看一下我们超级块的样子:
dumpe2fs /dev/sda1, oop!内容太多了,将内容重定向到文件里吧:
dumpe2fs /dev/sda1 > input
vi input
let us have a look at the content of input:
Filesystem volume name:
Last mounted on: /
Filesystem UUID: 83a4e993-4703-42ac-88ce-81f7b8c5ae35
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 30269440
Block count: 121072384
Reserved block count: 6053619
Free blocks: 115812611
Free inodes: 30026282
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 995
Blocks per group: 32768
全部回答
任务占坑
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
我的交行卡里面的钱可以转到建行卡里面来吗?
net view和net use这个命令只能在局域网用吗
近年来蜚声国际上的生态建筑师是:[2000-035
荷兰木鞋在荷兰本土多少钱一双(能穿的)?荷
一拳打破玻璃,手指掉了一大层皮,还能长好吗
现金支票和转账支票均既可以转账,也可以提取
医用双氧水对白色衣服领上的黄色污渍有洗净作
张密城村这个地址在什么地方,我要处理点事
7*9,67*99,667*999有什么规律
医疗诊断产业具体是什么概念???
下列能看成是一个生态系统的是CA. 一块农田中
华硕笔记本 开视频时画面很暗 在我的电脑里却
青海银泰置业公司地址有知道的么?有点事想过
无畏先锋人多吗
Notice: Undefined index: 信息怎么办? - 技
推荐资讯
小儿感冒每易夹惊,中医学认为是A.脾常不足B.
承德双滦考科二在哪
Elsevier 在全球出版业地位怎样?十分牛吗?
儿子13周岁
(18分)小鼠是遗传学研究的常用动物,请分析
办理公积金组合贷款,房屋登记证明(产权预告
什么是八分?八分书在哪个时期普及?
三星手机n9200怎么设置字体大小
很爱很爱你 空间背景音乐链接 要能用的,连通
我想问挂号费有一千多的医生吗
距离产生的不是美,是小三.
一品堂数码这个地址在什么地方,我要处理点事
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?