Unlike hard links, symbolic links (also called "soft" links) are just special files that point to a file or directory in your system. That's significant because you don't make a copy when you create a link. If you copy the file, though, the copy would get its own inode address, and it would consume another eight sectors. The inode address remains the same, which is important because regardless of the file size, it's always referenced by its inode address, not each individual sector consumed. That is because you're working with the default 4KiB block disk size and 512B sector size. The file now consumes eight sectors, even though you only added 1B of data. Learning path: Deploy a cluster in Red Hat OpenShift Service on AWS (ROSA).Get a Red Hat Learning Subscription trial.Learn about Red Hat Certified System Administrator (RHCSA) certification.Explore Red Hat training and certification options.Skip to bottom of list Skip to the bottom of list Size: 2 Blocks: 8 IO Block: 4096 regular file Add just one single byte of data to it and see what happens: $ echo 1 > dir/file The file has its own inode address (25606591), and it's 0 bytes in size because it has no contents. 1 localuser localuser 0 set 19 15:29 dir/file You can confirm the inode and check other metadata information with the stat command.Ĭreate a file inside this directory and check the same information: $ touch dir/file You can see that the inode address of the given dir directory below is 25606589. Use the ls command with the -i option to display inodes. You can see inodes in action by creating a directory and then looking at its inode and size information: $ mkdir dirĢ5606589 drwxrwxr-x. It stores metadata pertaining to that object, including time stamps, block maps, or extended attributes. A hard link can only point to a file, not a directory, and it doesn't add to the overall index node (inode) count.Īn inode is a data structure describing a filesystem object, such as a file or a directory. In my previous article, I demonstrated how to create a hard link that looks like a unique file but actually points back to another file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |