4 ms·
> creating arbitrary directories in / is a terrible idea, and has been at least since I started using UNIX/Linux systems in the 90's Why?
by matheusmoreira 7y ago
> creating arbitrary directories in / is a terrible idea, and has been at least since I started using UNIX/Linux systems in the 90's
Why?
- cesarb 7y agoBecause the root directory might be on a very small partition (perhaps only a few hundred megabytes), while other mount points like /usr might have more space; the only things which should be in / are the things which are necessary to mount the other filesystems (perhaps through the network using NFS). (Yes, nowadays hard disks are much larger, we have things like initrd, and we now make /bin and /sbin symlinks to within /usr, but the parent comment did mention the 90s...)
- chungy 7y agoEasy solution: /nix as its own partition with plenty of space.
- mixedCase 7y agoBecause the filesystem root is the domain of the OS, if tomorrow they decide they are going to create a symlink of /dev/null in /nix because they thought it sounded cooler as a way to "nix" stuff, there goes the Nix package manager. The OS gives you places to put your files, use them so that you prevent breakage. We have the FHS, so you even have some degree of certainty of where to do it across Unixes. EDIT: Two downvoted comments answering a "why" but no rebuttal to either. HN is slowly but surely becoming Reddit.
- ashtonkem 7y agoIt’s because Nix was designed to be part of the OS, as integral as apt is for Debian installations. The ability for it to live side by side with another packaging system is just a side-effect of how it was designed, not part of the original goals.
- mixedCase 7y agoAnd NixOS is a great idea, but Nix advertises itself as "a powerful package manager for Linux and other Unix systems" in its the official site's description. Yet by not abiding to the FHS, they opened themselves up for breakage.
- ashtonkem 7y agoThat’s an after the fact feature; my understanding is that the original design was intended to be the sole package manager on the system. This is backed up by the fact that NixOS and Nix appear to have both been created at the same time; 2003.
- Spivak 7y agoThis is wrong. Everything not specified in the FHS is the domain of the administrator and is a contract with the OS about what directories it wont touch. Nix, operating outside of the FHS, did the literal correct thing because there is no guarantee that the OS won’t install something in /opt/nix but there is a guarantee that it won’t touch /nix.
- mixedCase 7y agoAs a sysadmin you can do anything you want and are free to deal with the breakage you cause yourself. But the FHS pretty clearly establishes what behavior an application such as Nix should have: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03.html#purpose2 https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03.html#p... Quote: "Applications must never create or require special files or subdirectories in the root directory. Other locations in the FHS hierarchy provide more than enough flexibility for any package." They can choose not to abide the FHS, and that's fine if the users are happy with that tradeoff. But OSes observing the FHS are free to break Nix's expectations because they don't align with the FHS.
- Spivak 7y agoBut you’re missing the essential point which is that the FHS a set of rules that only apply to the distribution. > Applications [shipped by the distribution] should not... > Distributions should not create new directories in the root hierarchy without extremely careful consideration of the consequences including for application portability. The OS is free to break 3rd party applications that don’t follow their rules but strict adherence to the FHS is not the justification for doing so.
- dang 7y agoPlease read https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html and note the final two guidelines.