I hope someone can help me make sense of disks in Linux. I've read the articles and links and such. The problem is I'm having a hard time applying what I've read and "learned" so far with real world situations. I'm getting a little overwhelmed and confused, so I'm hoping someone can help me clarify things.
I think I understand that when you install Linux you have some partitioning and formatting options, like anything else. If you create only a swap and boot partition, your /etc/fstab might look something like this:
Quote:
/dev/sda1 / ext3 defaults 1 1
/dev/sda2 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
|
That means that all of the sub-directories under / (like /etc, /dev, etc) are all in one partition. So best practice, depending on the box you're building, suggests you separate out these things. So, you can create more partitions and give /usr its own, and /var its own, and so forth. Right so far?
Now, that's a fairly basic system. Let's say I run across an fstab that looks like this:
Quote:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/system-root
992M 372M 570M 40% /
/dev/mapper/system-var
3.9G 688M 3.1G 19% /var
/dev/md1 67G 43G 21G 69% /mywebsite
/dev/mapper/system-usr
7.8G 2.2G 5.2G 30% /usr
/dev/mapper/system-www
3.9G 3.7G 61M 99% /www
/dev/md0 67G 63G 2.7G 96% /var/lib/pgsql
/dev/mapper/system-tmp
992M 38M 904M 4% /tmp
/dev/sda1 99M 18M 77M 19% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
fileserver1:/mycompany/somedata
646G 296G 317G 49% /somedata
|
My take on this is (without getting into too much about RAID and LVM, which is way over my head), is that there are virtual disks created (these /dev/mapper nodes), and this allows the directories that are typically found under / to be spread out over multiple disks. So if I'm concerned about running out of space on /www, I would do du -sh /www to find out what in that directory is taking up the bulk of the 3.9GB allocated?
So, even though an "ls /" would list all of these directories, they still technically live under / but not necessarily on the same drive or partition? Does this mean that all of the other directories usually found under / (/lib, /tmp, etc) are still under this main partition and contribute to the overall size of /?
Am I understanding disk layout properly in this context?