Inode chứa metadata file (không phải tên); hard link là alias đến cùng inode; symlink là pointer đến path — khác nhau về behavior khi target bị xóa và khi cross-filesystem.
Inode (Index Node): metadata của file trong filesystem — chứa permissions, owner, timestamps, file size, block pointers (địa chỉ data blocks trên disk). KHÔNG chứa filename! Filename chỉ là entry trong directory trỏ đến inode number. stat file.txt hiển thị inode info. df -i xem inode usage (có thể hết inodes dù còn disk space). Hard link: tạo thêm directory entry trỏ đến cùng inode. ln file.txt hardlink.txt. Cả hai file là same data, same inode, same permissions. Xóa một file không xóa data — data chỉ xóa khi link count = 0 (tất cả hard links bị xóa). Không thể hard link qua filesystem khác hay directory. Symbolic link (symlink): là special file chứa path đến target. ln -s /path/to/target symlink. Symlink có inode riêng. Nếu target bị xóa → dangling symlink. Có thể symlink qua filesystem và directory. Ứng dụng: /etc/nginx/sites-enabled/ chứa symlinks đến /etc/nginx/sites-available/ — enable/disable site bằng cách tạo/xóa symlink. current symlink → deployment rollback.
Inodes store file metadata (not the name); hard links are aliases to the same inode; symlinks are pointers to a path — they differ in behavior when the target is deleted and when crossing filesystems.
Inode (Index Node): file metadata in the filesystem — contains permissions, owner, timestamps, file size, and block pointers (addresses of data blocks on disk). Does NOT contain the filename! A filename is just a directory entry that points to an inode number. stat file.txt displays inode info. df -i shows inode usage (you can run out of inodes even with free disk space). Hard link: creates an additional directory entry pointing to the same inode. ln file.txt hardlink.txt. Both files share the same data, inode, and permissions. Deleting one file does not delete the data — data is only removed when the link count reaches 0 (all hard links deleted). Cannot hard-link across filesystems or to directories. Symbolic link (symlink): a special file containing a path to the target. ln -s /path/to/target symlink. A symlink has its own inode. If the target is deleted → dangling symlink. Can symlink across filesystems and to directories. Applications: /etc/nginx/sites-enabled/ contains symlinks to /etc/nginx/sites-available/ — enable/disable a site by creating/removing the symlink. A current symlink enables deployment rollbacks.