I'm new to Linux and have a question that's been on my mind. Since everything in Linux is treated as files and directories, is it possible to create a new directory (like under `/dev/`) and have the system recognize it as its own partition? If that's not feasible, where does the system store partition information, and how is this data updated when I create, resize, or delete partitions? Sorry if this question seems basic, but I'd appreciate any guidance without diving too deep into documentation.
3 Answers
Creating a directory and creating a partition are two different things. You can make a directory almost anywhere and use it as a mount point for a file system. But `/dev/` is designated for device files that allow access to hardware, not for user data. Generally, you'd mount file systems under `/home` or `/srv`. The links between partitions and the OS are stored in the partition table, updated whenever you adjust partitions, and this data is recognized by the OS when it boots up or when devices are connected.
Putting it simply, no, you can't create a directory under `/dev/` and have that recognized as a separate partition. The idea of Linux treating everything like files is a bit of an oversimplification. The partition table, which is stored on the disk, holds the info about where your partitions are. Whenever you manipulate partitions, you're actually writing to this table.
The partition management programs are built to handle the partition table directly. You’re right that everything in Linux is treated as a file, but for partitions, it’s more about how the OS exposes access to disk devices. If you want to change partitions, you'd typically use tools like `fdisk` to edit that partition table stored on the disk.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures