LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2007, 01:36 PM   #1
SeRGeiSarov
Member
 
Registered: Jan 2007
Location: Russia, Nizhniy Novgorod Region, Sarov town
Distribution: Mandriva 2007, Fedore Core 6
Posts: 52

Rep: Reputation: 15
the on-disk structure of the ext3 file system


I read The UNIX Programming Environment by Brian W. Kernighan, Rob Pike and see in section the file system the following example:

...
$ date > x
$ ls -i
15768 junk
15274 recipes
15852 x
$ od -c .
0000000 4 ; . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000020 273 ( . . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000040 252 ; r e c i p e s \0 \0 \0 \0 \0 \0 \0
0000060 230 = j u n k \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000100 354 = x \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000120

When I have entered this example I see an error message

How to see the internal data structure of the ext3 filesystem?
 
Old 06-04-2007, 02:00 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
UNIX != Linux

Linux is a clone of UNIX rather than a direct variant. While many of the same commands exist with many of the same options they are not derived from the same source code and there is no guarantee the author of the Linux code made it do everything the equivalent UNIX code did. Often the Linux command will have additional options not found in the UNIX command.

Even in "UNIX" there are variants (e.g. HP-UX, Solaris, AIX, SCO) and though original source code might have been based on System V UNIX or BSD UNIX they often have their own take on what should be there. What keeps them more or less the same are POSIX standards but that deals with what must be included - it doesn't preclude adding what you think is helfpul.

The issue isn't the ext3 filesystem but the od command itself and it clearly says "." is a directory which is a hint that the Linux od doesn't accept "directories" as "files" as the UNIX od might. (e.g. on my HP-UX server od -c . works just fine).

If really interested you can get the source for the Linux od itself and see what error checking it does that spawns the message about directory. You could then modify the code to make your own od command that acts on directories. Personally I think it would be a lot easier just to say "od -c ./*" - it will show you information for each file just as the "od -c ." would have if it had worked.
 
0 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File system/structure question ashley75 Linux - General 1 05-17-2005 10:02 PM
How to freeze ext3 file system A-Liang Programming 8 09-23-2004 01:27 AM
How to ext3 file system A-Liang Programming 2 09-13-2004 11:14 PM
Large tar file taking huge disk space in ext3 file system pcwulf Linux - General 2 10-20-2003 08:45 AM
Quotas : ext3 file system tropical Linux - General 4 04-13-2003 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration