Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: USA, a place where an open-source document (The Constitution) is the law of the land.
Distribution: Debian (because of their underlying philosophies) running AwesomeWM (because of its functionality).
Posts: 34
Rep:
fat32 equivalent to ext* inodes.
fat32 equivalent to ext* inodes.
I am trying to write a bash script that addresses files on a fat32 formatted device without using filenames.
I would like to use inode numbers but it is my understanding that Linux creates temporary random numbers for fat32 devices to serve as inodes that change when the device is plugged into a different machine (unless I am wrong, if I am wrong please provide a link to something that says so).
What I need is a number that will be the same no matter what machine I mount the device on so I am choosing offset numbers (however if there is a better idea I am all ears).
My problem with my idea (as I see it) is that I cannot figure out what bash command there is that will list the offset posistion of a file on a fat32 filesystem.
The inode numbers can be inconsistent even between successive mounts on the same system. Looking at the kernel source (fs/inode.c), the inode numbers are assigned sequentially as they are needed. This means that the files in a subdirectory are not assigned inode numbers until that directory is visited. If you have directories dir1 and dir2, then from a fresh mount the inode numbers assigned to files in, for example, dir2 will be different if you first looked in dir1.
For finding the location, the "--fibmap" option of the hdparm command might be helpful.
Location: USA, a place where an open-source document (The Constitution) is the law of the land.
Distribution: Debian (because of their underlying philosophies) running AwesomeWM (because of its functionality).
Posts: 34
Original Poster
Rep:
I think that might be it! Now I just gotta figure out what I'm reading.
For a small text file on an ext2 filesystem (just a quick look before I go to bed) I see two rows of columns of 'byte_offset', 'begin_LBA', 'end_LBA', and 'sectors'.
I assume that the first 'begin_LBA' number is what I'm looking for?
By the way thanks. I spent all of last weekend google-searching this.
I'm sure it will become more apparent after a good night's sleep. Looking at the output for a file with multiple extents, perhaps /var/log/wtmp, might also make things more obvious.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.