Is it possible for the root and home partitions to have different filesystems and to be located on seprate physical devices?

Imagine I formatted the root with an ext3 filesystem on a separate partition that happens to exist on a SATA HDD and the home directory on a different btrfs partition that happens to exist on a Intel SSD.

I downloaded a file from the Internet and temporarily saved it to /tmp (in the root filesystem), then I decided to move it to my home directory (the second partition).

I can feel the painful process that happens in the background to make such a simple mv command work.

So, first, is it possible for the root and home to have different filesystems? Secondly, assuming the answer for the previous question was "yes", how does the OS manages all that transition from ext3 to btrfs and then using different device drivers for different disk types (HDD and SSD)?


The answer is yes, you can have any directory on any device, running any file system the OS can support.

So you can have / /var /home /opt and even /home/afr0ck on different devices, different partitions, different file systems.

Not only can you, but it is common. For example, it is always recommended to keep /var and /home on different partitions to / as these are most likely to inadvertently consume disk space - if they fill up, it doesn't impact the system too much. If they are on the same partition as root, it can cause the system to stop.

And you may want different directories to run on different devices for speed reasons. And use different filesystems for different purposes. For example, perhaps ext4 is what you want for the OS files, as they don't change much, but you might want btrfs for /home so you can keep snapshots for backups. These are all decisions that can be made by each person for their specific use case.

The user space part of the OS doesn't need to understand the different device and filesystem types. All it does it ask the kernel to move a file, and the kernel orchestrates everything from there. So the mv command (for example) is filesystem and device type agnostic. The kernel invokes whatever drivers are needed to read and write to the different partitions.


Yes, separate filesystems (mount points) can be different filesystem types.  /proc is always a procfs filesystem, and /sys is always a sysfs.  Transient filesystems (sometimes including /tmp) are often tmpfs, and, in workgroup settings, it’s common for the user’s home directories (and their work product directories) to be nfs or other remote (network/shared) filesystem types.

There isn’t any special management for the OS to do.  Up to a point, at the user level, all filesystems look alike, in the sense that an ls listing will look pretty much the same in any directory.  Beyond that point, filesystems don’t interact.  Even between two filesystems (partitions) on the same physical disk, of the same filesystem type, there’s no linkage1.  For example, moving a file from one filesystem (mount point) to another always involves making a copy and deleting the original.  Doesn’t matter if they’re partitions on different disks.  Doesn’t matter if one of them is HDD and one is SSD.  Doesn’t matter if one is ext3 and one is btrfs.  Doesn’t matter if one is internal (inside the computer case) and one is external (a few inches outside, connected by a cable) — or remote (accessed over the network).

Speaking of the network, it’s a little analogous to ssh.  It reads from the keyboard and sends the characters you type to the network.  Simultaneously, it reads from the network and displays the results on the screen.

Or consider this: imagine you’re on the phone, and you’re mediating a conversation between the person on the other phone and another person in the room.  It’s no big deal.
________
1 except for symbolic links — but they can cross filesystem boundaries.