[SOLVED] inode for tagging system

If none of the more specific forums is the right place to ask

[SOLVED] inode for tagging system

Postby juliorollan » 2019-01-18 15:31

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.
Last edited by juliorollan on 2019-01-24 16:24, edited 1 time in total.
juliorollan
 
Posts: 17
Joined: 2016-08-23 16:22
Location: Argentina

Re: inode for tagging system

Postby Head_on_a_Stick » 2019-01-18 16:52

Code: Select all
ls -i $file
User avatar
Head_on_a_Stick
 
Posts: 10346
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: inode for tagging system

Postby p.H » 2019-01-18 20:40

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.
p.H
 
Posts: 1039
Joined: 2017-09-17 07:12

Re: inode for tagging system

Postby dilberts_left_nut » 2019-01-18 20:53

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...
User avatar
dilberts_left_nut
 
Posts: 4994
Joined: 2009-10-05 07:54
Location: enzed

Re: inode for tagging system

Postby juliorollan » 2019-01-19 14:25

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.

That is why I explicitly said linux. Twice. I do not care about microsoft's fs.

p.H wrote:- Inode numbers are filesystem internals and are not intended for users.

Why not use inodes to identify files?

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.

I will check this. Thanks for pointing, never thought of it.

dilberts_left_nut wrote:You want the tags in the file, not the filesystem, or it's not portable, and therefore mostly useless.

Yeah, but what about the search speed? I was thinking of a DB, and therefore, asked about the inodes.

BTW, my questions are not answered so far.

Thanks!
juliorollan
 
Posts: 17
Joined: 2016-08-23 16:22
Location: Argentina

Re: inode for tagging system

Postby juliorollan » 2019-01-19 15:46

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?
juliorollan
 
Posts: 17
Joined: 2016-08-23 16:22
Location: Argentina

Re: inode for tagging system

Postby p.H » 2019-01-19 17:53

juliorollan wrote:That is why I explicitly said linux. Twice. I do not care about microsoft's fs.

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:Why not use inodes to identify files?

Do you mean inode numbers ?
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.

juliorollan wrote:could you explain a little more about what you said of "native inodes"?

Native Linux filesystems such as the ext* family use real inodes to store file metadata.
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.
p.H
 
Posts: 1039
Joined: 2017-09-17 07:12

Re: inode for tagging system

Postby juliorollan » 2019-01-24 07:10

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!
juliorollan
 
Posts: 17
Joined: 2016-08-23 16:22
Location: Argentina

Re: inode for tagging system

Postby p.H » 2019-01-24 12:58

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.
p.H
 
Posts: 1039
Joined: 2017-09-17 07:12

Re: inode for tagging system

Postby juliorollan » 2019-01-24 16:22

Yes, that's correct. I said attr but meant those intended for ext4.
juliorollan
 
Posts: 17
Joined: 2016-08-23 16:22
Location: Argentina


Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable