What does linux put in inode 2 of ext2 filesystem?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
glauxosdev
Member
Member
Posts: 119
Joined: Tue Jan 20, 2015 9:01 am
Libera.chat IRC: glauxosdever

What does linux put in inode 2 of ext2 filesystem?

Post by glauxosdev »

https://www.imageupload.co.uk/image/Zc88
What is this in red supposed to mean? Does not look like a file/directory/etc entry. File length 0BBh, file type 0CEh... Odd...
Could someone enlighten me?

Regards,
glauxosdev
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: What does linux put in inode 2 of ext2 filesystem?

Post by iansjack »

It's an unused part of the block. I've no idea how it got there in your particular instance as it doesn't look like a deleted entry. Whatever, it's doing no harm.
glauxosdev
Member
Member
Posts: 119
Joined: Tue Jan 20, 2015 9:01 am
Libera.chat IRC: glauxosdever

Re: What does linux put in inode 2 of ext2 filesystem?

Post by glauxosdev »

And how should my code know how to skip it?
I've no idea how it got there in your particular instance
I formatted my flash drive as ext2, I created a folder "sys" and I copied "docs", "programs", "source" and "system".

Edit: sometimes the length of this unused block is specified in place of file name length.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: What does linux put in inode 2 of ext2 filesystem?

Post by iansjack »

And how should my code know how to skip it?
I've said it before, but it looks like I have to say it again.

Before you can work with ext2fs at a low level you have to understand the filesystem, its structures, and how they are used. And you have to at the very least read that document that I linked to describing the ext2 filesystem. It is evident that you have not yet reached that stage. I suggested before a way that you could work towards that level of enlightenment; you rejected my suggestion then, so there seems to be little point in repeating it now.

There is no easy path to OS development, and asking someone else to help you every time you hit something that you don't understand is not the magical path.

But, to answer your question: your code knows how to skip it because it reads the directory from the disk in the way it was designed to be read.
Post Reply