Whereas it will not be apparent to the informal consumer, Linux file methods have advanced considerably during the last decade or so to make them extra immune to corruption and efficiency issues.
Most Linux methods right this moment use a file system kind referred to as ext4. The “ext” half stands for “prolonged” and the Four signifies that that is the 4th era of this file system kind. Options added over time embody the flexibility to offer more and more bigger file methods (at present as giant as 1,000,000 TiB) and far bigger recordsdata (as much as 16 TiB), extra resistance to system crashes and fewer fragmentation (scattering single recordsdata as chunks in a number of places) which improves efficiency.
The ext4 file system kind additionally got here with different enhancements to efficiency, scalability and capability. Metadata and journal checksums have been carried out for reliability. Timestamps now monitor modifications all the way down to nanoseconds for higher file time-stamping (e.g., file creation and final updates). And, with two extra bits within the timestamp area, the 12 months 2038 downside (when the digitally saved date/time fields will roll over from most to zero) has been postpone for greater than 400 years (to 2446).
File system sorts
To find out the kind of file system on a Linux system, use the df command. The T possibility within the command proven beneath offers the file system kind. The h makes the disk sizes “human-readable”; in different phrases, adjusting the reported models (corresponding to M and G) in a approach that makes essentially the most sense to the individuals studying them.
$ df -hT | head -10 Filesystem Sort Dimension Used Avail Use% Mounted on udev devtmpfs 2.9G 0 2.9G 0% /dev tmpfs tmpfs 596M 1.5M 595M 1% /run /dev/sda1 ext4 110G 50G 55G 48% / /dev/sdb2 ext4 457G 642M 434G 1% /apps tmpfs tmpfs 3.0G 0 3.0G 0% /dev/shm tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup /dev/loop0 squashfs 89M 89M 0 100% /snap/core/7270 /dev/loop2 squashfs 142M 142M 0 100% /snap/hexchat/42
Discover that the / (root) and /apps file methods are each ext4 file methods whereas /dev is a devtmpfs file system – one with automated machine nodes populated by the kernel. A few of the different file methods proven are tmpfs – short-term file methods that reside in reminiscence and/or swap partitions and squashfs – file methods which can be read-only compressed file methods and are used for snap packages.
There’s additionally proc file methods that shops info on working processes.
$ df -T /proc Filesystem Sort 1K-blocks Used Accessible Use% Mounted on proc proc 0 0 0 - /proc
There are a variety of different file system sorts that you just may encounter as you are shifting across the general file system. Whenever you’ve moved right into a listing, for instance, and need to ask concerning the associated file system, you’ll be able to run a command like this:
$ cd /dev/mqueue; df -T . Filesystem Sort 1K-blocks Used Accessible Use% Mounted on mqueue mqueue 0 0 0 - /dev/mqueue $ cd /sys; df -T . Filesystem Sort 1K-blocks Used Accessible Use% Mounted on sysfs sysfs 0 0 0 - /sys $ cd /sys/kernel/safety; df -T . Filesystem Sort 1K-blocks Used Accessible Use% Mounted on securityfs securityfs 0 0 0 - /sys/kernel/safety
As with different Linux instructions, the . in these instructions refers back to the present location within the general file system.
These and different distinctive file-system sorts present some particular capabilities. For instance, securityfs offers file system assist for safety modules.
Linux file methods have to be immune to corruption, have the flexibility to outlive system crashes and supply quick and dependable efficiency. The enhancements supplied by the generations of ext file methods and the brand new era on purpose-specific file system sorts have made Linux methods simpler to handle and extra dependable.