Monday, April 15, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2267  / 3 Years ago, sat, august 14, 2021, 2:40:32

I'm new to Linux and I've set up a Ubuntu physical machine with 1 SSD (PCIE) and 2 HDDs (SATA). I know all file directories start with the root directory '/' in cmd, but is there a way to know the physical locations of the files, like which file is stored in which HDD or SSD (similar to Windows OS). Thanks a lot.


More From » 20.04

 Answers
7

File systems are "hinged into" the main file tree at specified locations. That principle is called mounting.


Let's say you have a hard disk sda, with (among others) a partition sda7. If you mount that partition (or rather, the file system on the partition) to the mount point /var/data/something, all files that this file system contains will be visible below /var/data/something.


If you look at this idea the other way around, a file that you generate below a mount point will go to the respective filesystem, partition and physical device. So if you write data to, say, /var/data/something/else/my/data/file.txt, this file will reside (as we've seen above) on the file system mounted to /var/data/something, which is on the partition sda7, which is in turn on the physical device sda.


You probably know what has been mounted to which mount points from setting up the server. In case you don't know, you can list all currently mounted file systems with the mount command. This should give you a list of entries like


...
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda4 on /home type ext4 (rw,relatime,errors=remount-ro)
/dev/sda7 on /var/data/something type ext4 (rw,relatime,errors=remount-ro)
...

How devices are named (the sda in this example) would be question of its own. It mostly depends on the type of the device and which type of controller it's conntected to.


[#1264] Monday, August 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aciousoun

Total Points: 178
Total Questions: 110
Total Answers: 98

Location: Lithuania
Member since Fri, Sep 4, 2020
4 Years ago
;