Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
FORUM
HO WT O S & FA Q S
L OW GRA P HICS
S HE L L S CRIP T S
RS S /FE E D
This is second part of "Understanding UNIX/Linux file system", part I is here. Let us take an example of 20 GB hard disk. The entire disk space subdivided into multiple file system blocks. And blocks used for what?
Youtube | Twitter | Google +
pdfcrowd.com
Superblock
Each file system is different and they have type like ext2, ext3 etc. Further each file system has size like 5 GB, 10 GB and status such as mount status. In short each file system has a superblock, which contains information about file system such as: File system type Size Status Information about other metadata structures If this information lost, you are in trouble (data loss) so Linux maintains multiple redundant copies of the superblock in every file system. This is very important in many emergency situation, for example you can use backup copies to restore damaged primary super block. Following command displays primary and backup superblock location on /dev/sda3:
# dumpe2fs /dev/hda3 | grep -i superblock
Output:
Primary superblock at 0, Group descriptors at 1-1 Backup superblock at 32768, Group descriptors at 32769-32769 Backup superblock at 98304, Group descriptors at 98305-98305 Backup superblock at 163840, Group descriptors at 163841-163841 Backup superblock at 229376, Group descriptors at 229377-229377 Backup superblock at 294912, Group descriptors at 294913-294913
pdfcrowd.com
Part III - An example of Surviving a Linux Filesystem Failures Part IV - Understanding filesystem Inodes Part V - Understanding filesystem directories Part VI - Understanding UNIX/Linux symbolic (soft) and hard links Part VII - Why isn't it possible to create hard links across file system boundaries?
Tw eet 11 1 Like 5 Subm it 29,187 people like nixC raft.
nixCraft
Like
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles: 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X Top 30 Nmap Command Examples For Sys/Network Admins 25 PHP Security Best Practices For Sys Admins 20 Linux System Monitoring Tools Every SysAdmin Should Know 20 Linux Server Hardening Security Tips Linux: 20 Iptables Examples For New SysAdmins Top 20 OpenSSH Server Best Security Practices Top 20 Nginx WebServer Best Security Practices 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors 15 Greatest Open Source Terminal Applications Of 2012 My 10 UNIX Command Line Mistakes Top 10 Open Source Web-Based Project Management Software Top 5 Email Client For Linux, Mac OS X, and Windows Users The Novice Guide To Buying A Linux Laptop
How to: Linux / UNIX Delete or Remove Files With Inode Number Understanding UNIX / Linux filesystem Inodes Why isnt it possible to create hard links across file system boundaries? Understanding UNIX / Linux filesystem directories RE L A TE D P O S TS
pdfcrowd.com
Anonymous
# dumpe2fs /dev/hda3grep -i superblock above command is not running here |(pipe) is missing, anyway I am getting different output as you mentioned [root@sachan /root]# dumpe2fs /dev/hda1 | grep -i superblock dumpe2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09 [root@sachan /root]#
REPLY
nixcraft
Opps pipe was missing, thanks for heads up. Hmm it should give the output.
REPLY
Mount a Linux filesystem on a SAN from multiple nodes at the same time
Kristian
It should be mentioned that dumpe2fs only is for the ext2/ext3 file systems.
REPLY
bipul
pdfcrowd.com
Swapnil
Hi Vivek,
I have a doubt as how many redundant backups of superblock are created in the file system ? Is it made on every block group or only on initial few block groups ? In the filesystem that I created of size 128 MB with 16 block groups, when I run the dumpe2fs command on it, it gives the info on superblocks (These are not the exact wordings of the output ) : primary superblock is present on block group 0, back up superblock is present on block group 1, 3, 5, 7, 9. Similarly for a file system with 256 MB size and 31 block groups, primary superblock is present on block group 0 and backups are present on block groups 1,3,5,7, and 9. So my doubt is how does the file system how many backups of the superblock to be created ? And the same doubt for block group descriptors as well. Block group descriptors are not present in each block group but only in the block groups where superblock is present. Hoping for an earliest response. Thanks, Swapnil
REPLY
Sunil
pdfcrowd.com
[sunilv@lnx202-28 ~]$ dump2fs /u/sunilv | grep -i superblock dump2fs: Command not found.
REPLY
rakesh
vivek
Use full path /sbin/dumpe2fs, you are logged in as regular user and /sbin and /usr/sbin not in PATH settings.
REPLY
To Swapnil, You have sparse_super mode so super block and backups are saved in groups 0,1,3^n,5^n,7^n (e.g. 0,1,3,5,7,9,25,27,). If you take a look at mke2fs code, youll see these places where super blocks are saved. p.s. this is a very late comment but just wanted to comment..
REPLY
pdfcrowd.com
Govindasamy C
10
Its working fine for me sunil i think you did not give space after the command dumpe2fs
REPLY
sox
11
saikumar
12
is it possible to install linux in personal lappies? core2duo processor( dell laptop) is it possible even vmware workstation is installed in laptops.
REPLY
lanh
13
Good content; I like how you explain this topic very simply, as linux is typically hard to grasp.
REPLY
Aravind
14
pdfcrowd.com
Very fine . . . . . . .u
REPLY
Leave a Comment
Name * E-mail * Website
You can use these H T M L tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href ="" title="">
Security Question:
What is 14 + 6 ?
Solve the simple math so w e know that you are a human and not a bot.
Submit
open in browser PRO version
Are you a developer? Try out the HTML to PDF API
pdfcrowd.com
Tagged as: internal data structures, linux filesystem, metadata structure, superblock, unix filesystem
P RE V IOUS P OS T : NE X T P OS T :
pdfcrowd.com