Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] inode for tagging system
-
- Posts: 17
- Joined: 2016-08-23 16:22
- Location: Argentina
[SOLVED] inode for tagging system
Hello again to everyone willing to enlight and help!
This time I have a question related to inodes.
I know the inode is a unique information set of data that identifies a file uniquely on a given linux system. So far so good.
I am developing a script to tag multimedia files, basically photos and videos, so it is easier to find relevant files. I have tried a couple of apps but they are not as consistent as I expected.
My questions are:
1) If I have /home mounted on a separate partition, does the inode of the files on /home change if I share that partition between two different linux systems?
2) If I have multimedia files in an external drive, does the inode of the files on that drive change between different linux systems?
I case they change, how can I identify those files uniquely even when their name is changed?
Are you aware of a really robust and consistent tag system?
Thanks for your time!
Best regards!
*Edit: topic name.
This time I have a question related to inodes.
I know the inode is a unique information set of data that identifies a file uniquely on a given linux system. So far so good.
I am developing a script to tag multimedia files, basically photos and videos, so it is easier to find relevant files. I have tried a couple of apps but they are not as consistent as I expected.
My questions are:
1) If I have /home mounted on a separate partition, does the inode of the files on /home change if I share that partition between two different linux systems?
2) If I have multimedia files in an external drive, does the inode of the files on that drive change between different linux systems?
I case they change, how can I identify those files uniquely even when their name is changed?
Are you aware of a really robust and consistent tag system?
Thanks for your time!
Best regards!
*Edit: topic name.
Last edited by juliorollan on 2019-01-24 16:24, edited 1 time in total.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 132 times
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: inode for tagging system
Native inode numbers do not change. However,
- Not all filesystem types use inodes. Microsoft filesystems such as FAT and NTFS do not use inodes. Linux will create volatile virtual inode numbers with these filesystems.
- Inode numbers are filesystem internals and are not intended for users.
You may consider using extended file attributes on filesystems which support them. Extended attributes are managed with tools from the attr package.
- Not all filesystem types use inodes. Microsoft filesystems such as FAT and NTFS do not use inodes. Linux will create volatile virtual inode numbers with these filesystems.
- Inode numbers are filesystem internals and are not intended for users.
You may consider using extended file attributes on filesystems which support them. Extended attributes are managed with tools from the attr package.
- dilberts_left_nut
- Administrator
- Posts: 5346
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 12 times
- Been thanked: 66 times
Re: inode for tagging system
You want the tags in the file, not the filesystem, or it's not portable, and therefore mostly useless.
AdrianTM wrote:There's no hacker in my grandma...
-
- Posts: 17
- Joined: 2016-08-23 16:22
- Location: Argentina
Re: inode for tagging system
That is why I explicitly said linux. Twice. I do not care about microsoft's fs.p.H wrote: - Not all filesystem types use inodes. Microsoft filesystems such as FAT and NTFS do not use inodes. Linux will create volatile virtual inode numbers with these filesystems.
Why not use inodes to identify files?p.H wrote:- Inode numbers are filesystem internals and are not intended for users.
I will check this. Thanks for pointing, never thought of it.p.H wrote: You may consider using extended file attributes on filesystems which support them. Extended attributes are managed with tools from the attr package.
Yeah, but what about the search speed? I was thinking of a DB, and therefore, asked about the inodes.dilberts_left_nut wrote: You want the tags in the file, not the filesystem, or it's not portable, and therefore mostly useless.
BTW, my questions are not answered so far.
Thanks!
-
- Posts: 17
- Joined: 2016-08-23 16:22
- Location: Argentina
Re: inode for tagging system
p.H.: could you explain a little more about what you said of "native inodes"? As far as I knew, inodes where assigned once by the system. So, I deduce for what you said that a file has, in its meta info, an inode?
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: inode for tagging system
A Linux system can use Microsoft's filesystems. External drives are often formatted with FAT or NTFS, even when they are used with Linux machines.juliorollan wrote:That is why I explicitly said linux. Twice. I do not care about microsoft's fs.
Do you mean inode numbers ?juliorollan wrote:Why not use inodes to identify files?
The inode number change changes when you move the file to another filesystem.
Inode numbers are unique within a single filesystem, but not across all filesystems. Different files on different filesystems may have the same inode number.
Native Linux filesystems such as the ext* family use real inodes to store file metadata.juliorollan wrote:could you explain a little more about what you said of "native inodes"?
Other filesystems such as FAT or NTFS do not use inodes. When such a filesystem is mounted, the kernel dynamically creates fake inodes to handle the files. These inodes are virtual and volatile (not written to the filesystem) and their numbers change at each mount.
-
- Posts: 17
- Joined: 2016-08-23 16:22
- Location: Argentina
Re: inode for tagging system
p.H., thanks for your reply and explanation. I already knew what you said but thought there was something else.
I do not use microsoft's fs so all my external drives are ext4 formatted.
So, after all this comments, I guess my best shot would be to have a "multimedia nas", say using an old computer as storage engine and developing the application there, accessing via http or ssh (will only be used over LAN). And using the attr command to append the tags to the files.
I am developing on PHP, just because I like it and allows me to create a friendly GUI in the future (now I am using PHP cli).
Regards!
I do not use microsoft's fs so all my external drives are ext4 formatted.
So, after all this comments, I guess my best shot would be to have a "multimedia nas", say using an old computer as storage engine and developing the application there, accessing via http or ssh (will only be used over LAN). And using the attr command to append the tags to the files.
I am developing on PHP, just because I like it and allows me to create a friendly GUI in the future (now I am using PHP cli).
Regards!
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: inode for tagging system
IIUC its manpage, the 'attr' command is intended only for XFS. If you are using another filesystem type which supports extended attributes such as ext4, you should use 'getfattr' and 'setfaddr' from the same 'attr' package instead.
-
- Posts: 17
- Joined: 2016-08-23 16:22
- Location: Argentina