1 00:00:06,900 --> 00:00:07,830 - In the previous lesson 2 00:00:07,830 --> 00:00:10,170 you have learned how to work with partitions. 3 00:00:10,170 --> 00:00:12,510 Now I'm going to teach you what to do with them. 4 00:00:12,510 --> 00:00:14,173 That means filesystems. 5 00:00:15,040 --> 00:00:18,150 A filesystem is used to store files on disks. 6 00:00:18,150 --> 00:00:20,640 You cannot store files directly on a partition. 7 00:00:20,640 --> 00:00:22,290 You need a filesystem. 8 00:00:22,290 --> 00:00:24,227 And that is because filesystems 9 00:00:24,227 --> 00:00:28,920 are addressing blocks to take care of the file allocation. 10 00:00:28,920 --> 00:00:31,487 And Linux filesystems in general are compatible 11 00:00:31,487 --> 00:00:34,560 to the POSIX standard, which defines properties 12 00:00:34,560 --> 00:00:36,410 that can be stored in the filesystem. 13 00:00:37,350 --> 00:00:39,783 And these properties are stored in the inode. 14 00:00:40,890 --> 00:00:42,780 In the inode, specific blocks 15 00:00:42,780 --> 00:00:44,640 that are used for storage are addressed 16 00:00:44,640 --> 00:00:47,400 and other features are stored as well. 17 00:00:47,400 --> 00:00:49,770 And these features include user information, 18 00:00:49,770 --> 00:00:51,600 permission dates, and advanced features 19 00:00:51,600 --> 00:00:53,272 that might be used. 20 00:00:53,272 --> 00:00:56,520 Short, anytime you use LS minus L, 21 00:00:56,520 --> 00:00:58,833 the result comes from the inode. 22 00:01:00,420 --> 00:01:03,000 There are different filesystem types. 23 00:01:03,000 --> 00:01:06,930 Most filesystems are used to store files on block devices. 24 00:01:06,930 --> 00:01:09,300 There are also remote filesystems like NFS 25 00:01:09,300 --> 00:01:12,570 which define how files are stored on remote servers 26 00:01:12,570 --> 00:01:15,840 or pseudo filesystems like /proc, /dev, and /sys 27 00:01:15,840 --> 00:01:17,190 which are managed by the kernel 28 00:01:17,190 --> 00:01:20,163 and used for Linux internal administrative processes. 29 00:01:21,120 --> 00:01:23,992 That is the Virtual Filesystem or VFS, which is used 30 00:01:23,992 --> 00:01:28,350 by the Linux kernel as a generic filesystem interface. 31 00:01:28,350 --> 00:01:30,150 And the VFS allows for working 32 00:01:30,150 --> 00:01:34,230 with different filesystems by using specific kernel modules. 33 00:01:34,230 --> 00:01:37,230 And that's convenient because of the VFS, 34 00:01:37,230 --> 00:01:39,810 The kernel only has to deal with one filesystem, 35 00:01:39,810 --> 00:01:41,310 that's the VFS. 36 00:01:41,310 --> 00:01:43,740 And the VFS is the abstraction layer 37 00:01:43,740 --> 00:01:46,920 where all the other filesystems are plugging in. 38 00:01:46,920 --> 00:01:49,443 Let me visualize how this VFS is working. 39 00:01:51,870 --> 00:01:53,520 Alright, so let me show you 40 00:01:53,520 --> 00:01:56,190 how these filesystems are organized. 41 00:01:56,190 --> 00:01:58,290 In the end, it all starts with the kernel. 42 00:01:59,490 --> 00:02:00,750 And the thing is that the kernel 43 00:02:00,750 --> 00:02:04,170 doesn't like all these different drivers too much. 44 00:02:04,170 --> 00:02:06,353 So the kernel talks to VFS 45 00:02:06,353 --> 00:02:10,650 and the VFS is the Virtual File System. 46 00:02:10,650 --> 00:02:13,710 It's a generic abstraction of all the file systems. 47 00:02:13,710 --> 00:02:16,680 And next, because of this VFS, 48 00:02:16,680 --> 00:02:18,999 you have these different file system modules 49 00:02:18,999 --> 00:02:23,999 like XFS and Ext4 and BtrFS, 50 00:02:27,630 --> 00:02:29,820 and whatever you want. 51 00:02:29,820 --> 00:02:31,650 There's one special filesystem module 52 00:02:31,650 --> 00:02:33,840 that I would like to mention as well. 53 00:02:33,840 --> 00:02:35,760 And it is FUSE. 54 00:02:35,760 --> 00:02:38,910 FUSE is for FileSystems in User Space. 55 00:02:38,910 --> 00:02:40,920 Now why is FUSE interesting? 56 00:02:40,920 --> 00:02:44,086 Well, FUSE is interesting because it allows you to to work 57 00:02:44,086 --> 00:02:46,452 with filesystems that are not directly supported 58 00:02:46,452 --> 00:02:48,948 by the Linux kernel. 59 00:02:48,948 --> 00:02:53,010 Like for instance, the ZFS filesystem. 60 00:02:53,010 --> 00:02:55,080 There's no direct support, 61 00:02:55,080 --> 00:02:57,180 but the fact that it's not directly supported 62 00:02:57,180 --> 00:03:00,390 is taken away by using this FUSE driver. 63 00:03:00,390 --> 00:03:03,688 And that is how Ubuntu is offering support 64 00:03:03,688 --> 00:03:06,540 for this ZFS filesystem. 65 00:03:06,540 --> 00:03:08,650 FUSE is interesting because through FUSE 66 00:03:09,647 --> 00:03:11,160 you can virtually support any filesystem 67 00:03:11,160 --> 00:03:12,513 in a Linux environment. 68 00:03:15,510 --> 00:03:16,800 So on Linux you will find 69 00:03:16,800 --> 00:03:19,710 a couple of common filesystems 70 00:03:19,710 --> 00:03:21,990 to start with, there is Ext4, 71 00:03:21,990 --> 00:03:24,660 which is old, mature, very reliable, 72 00:03:24,660 --> 00:03:27,030 and still the most common filesystem. 73 00:03:27,030 --> 00:03:28,955 It is used on Ubuntu, for instance, 74 00:03:28,955 --> 00:03:30,723 as a default filesystem. 75 00:03:32,190 --> 00:03:36,150 XFS was introduced in 1993 by SGI 76 00:03:36,150 --> 00:03:39,450 as the first 64-bit high performance filesystem. 77 00:03:39,450 --> 00:03:42,120 And it has been adopted by Red Hat Enterprise, Linux, 78 00:03:42,120 --> 00:03:44,460 and later as a default filesystem. 79 00:03:44,460 --> 00:03:47,470 You still find it as a default filesystem in L9. 80 00:03:48,780 --> 00:03:51,750 Btrfs or butter Fs as we should say, 81 00:03:51,750 --> 00:03:55,890 is a Copy on Write or CoW file system. 82 00:03:55,890 --> 00:03:57,930 That's also the joke where Butter FS comes 83 00:03:57,930 --> 00:04:00,213 from according to the main developer. 84 00:04:01,073 --> 00:04:02,760 BtrFS is a cow file system, and butter comes 85 00:04:02,760 --> 00:04:06,390 from a cow and that's why you should say butter Fs. 86 00:04:06,390 --> 00:04:08,910 So this Copy on Write file system uses internal 87 00:04:08,910 --> 00:04:12,360 logical volumes to address files in a flexible way. 88 00:04:12,360 --> 00:04:13,659 It is used 89 00:04:13,659 --> 00:04:17,013 by different distributions including Susa and Fedora Linux. 90 00:04:18,210 --> 00:04:22,230 And there are other filesystems as well, like ZFS 91 00:04:22,230 --> 00:04:24,210 which is comparable to Btrfs 92 00:04:24,210 --> 00:04:26,373 but not supported by the Linux kernel. 93 00:04:27,210 --> 00:04:29,572 Some Linux distributions play a trick to 94 00:04:29,572 --> 00:04:34,572 include ZFS as well, but ZFS is really a BSD file system 95 00:04:36,120 --> 00:04:37,443 not a Linux file system. 96 00:04:38,520 --> 00:04:41,640 Ntfs-ng is a Linux implementation 97 00:04:41,640 --> 00:04:44,690 for a Windows NTFS compatible filesystem. 98 00:04:45,558 --> 00:04:50,190 exfat and vfat are the most compatible filesystems. 99 00:04:50,190 --> 00:04:53,430 They work on all operating systems like Windows and MacOS 100 00:04:53,430 --> 00:04:54,810 and also Linux, 101 00:04:54,810 --> 00:04:56,820 and therefore they are perfect candidate 102 00:04:56,820 --> 00:04:58,680 for USB thumb drive 103 00:04:58,680 --> 00:05:02,490 of the two, exfat is newer, vfat is older 104 00:05:02,490 --> 00:05:05,130 so exfat is probably the best candidate 105 00:05:05,130 --> 00:05:07,173 for formatting your USB media. 106 00:05:08,250 --> 00:05:10,860 There's NFS, which is the Network Filesystem. 107 00:05:10,860 --> 00:05:12,540 It has been available as a default 108 00:05:12,540 --> 00:05:14,883 for file sharing on Unix for decades. 109 00:05:16,154 --> 00:05:17,730 And CIFs is another remote file system. 110 00:05:17,730 --> 00:05:19,680 It's Common Internet FileSystem (CFIS) 111 00:05:19,680 --> 00:05:22,410 and it is used to access Windows shares. 112 00:05:22,410 --> 00:05:24,954 In the next video I'll tell you more 113 00:05:24,954 --> 00:05:26,263 about Ext4 filesystems.