File System Types - Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this lesson we're going to spend a few minutes talking about creating Linux file systems now let's suppose you've got a Linux system running and you use it every day to do a lot of different things and you're running out of disk space so in order to get extra storage space you go out to your local big box store you find a hard disk drive you install that hard disk drive in the computer and then you load up either the eff disk or maybe the G disk utility and you create a new Linux partition on it so now you've got all that extra storage space that you can save data on right wrong actually you don't why even though you partition the hard disk drive you have not yet created a file system on that partition now after you've created a partition on Linux you can't use that space to store data until you format it with a file system basically this is creating a file system is analogous to formatting a partition on a Windows system now you make a file system on a partition on a hard disk in the Linux system using the make FS command and as you might guess make FS dance or make file system you can use the make FS utility to make an ext two file system ext3 ext4 and so on you can even use it to create a fat32 or even an NTFS file system on a partition these file system types would allow that partition to be used on both Linux and on Windows now be aware that the make FS utility is really just a front end for the real commands that actually make each specific type of file system and these are shown here you actually find all of these commands on your Linux system for example to create an ext4 file system make FS actually runs the make FS txt for command same for ext3 ext4 filesystem fat filesystem NTFS filesystem and so on now if you wanted to you could skip running make FS and actually run the particular real command if you wanted to and these are located in the /s bin directory by the way however most Linux administrators just use the make FS front end to run the appropriate command if you do decide to use one of these commands and to make FS you'll need to go and look at the man page for that particular make FS command to see what syntax it uses so to create a new file system on a partition in the Linux system you first run the make FS command and then you use the - T option to specify which type of filesystem you want to create in this example we're going to create an ext4 filesystem which would then run the make FS txt for command that we just talked about and then you have to specify which partition you want to create that file system on in this case we're going to create it on slash dev /s db5 now when you run the make FS command there are several other options you can use in addition to - d to customize the way that filesystem is going to be created for example you can use the - b option to specify the size of the data blocks on the system if you use the - b option you need to specify the block size that you want to use there are three values that are allowed 1024 2048 or 4096 and you'll have to decide for yourself which one is best for the particular implementation you are installing the general rule of thumb is if your Linux system will store very large files then you can use a very large block size if on the other hand your limbic system will be storing a lot of little teeny-tiny files that change frequently then a large block size will not use this space efficiently and you should use a smaller ones such as 1024 you can also use the - end option to specify how many eye nodes are going to be created within the filesystem now remember and inode stores basic information about a file in the Linux file system it specifies the size of the file the device where that file exists who owns that file and all the permissions that have been assigned to the file now here's the key thing that you need to remember each file has its own inode and with the exception of hard link files with share I notes with every other Linux file each file has its own inode therefore specifying a hard number of I nodes effectively limits the total number of files that will be allowed to be created on that file system because when that limit is reached you'll not be allowed to anymore you can also use the - I option to specify the size of the inode typically I don't do this I just use the defaults which I believe by default will size the inode to be the same as the block size of the filesystem and then you can use the - J option to create a journal on the filesystem we don't use this option very much anymore for a while we used it a lot back in the days when we were migrating from ext2 ext3 because you could use - j essentially to convert an ext to file system to an ext3 file system by simply adding a journal to the ext2 file system because there aren't very many ext2 file systems around anymore you probably won't use that option very often now if you don't include any options when you're in the make F s command then default values will be used for you and to be honest that's usually what I do on very rare occasions I might override the defaults but for the most part using the default values determined by make FS usually works pretty good and this is because an optimal block size and an optional number of I nodes will be automatically calculated for you based upon the size of the partition in the example you see right here I'm using the make FS command to create an ext4 filesystem on the slash dev /s db5 partition when make FS ran it looked at the size of the partition which is actually really tiny then it determined these optimal parameters for that partition now be aware that these are not the default values used by make FS in all cases remember it automatically determines what the best sizes should be for the particular partition and file system in question in this case it decided that the best block size was 4 kilobytes 4096 it also decided that this many blocks and this many AI nodes should be created in the file system and in fact if you multiply the total number of blocks by the block size you can determine the size of the overall filesystem the amount of storage space in the filesystem which in this case I think works out to like 5 gigabytes or so fortified gigabytes and also notice over here that it specifies that super block backups will be stored in these blocks in the file system now the super block is the block at the very beginning of the partition and that is called block 0 and this is a very important block because it contains information about the overall structure of the entire file system on that partition so in this file system what make FS is going to do is place redundant copies of this block in these locations that way if something happens to this block for some reason we have backups available now in addition to the make FS command there's also another utility that you can use to create a file system on a partition on a hard drive in the Linux system and it's not used very often anymore and that is the make riser FS command this utility creates a riser file system on a partition at one time about a decade ago riser was the up and coming file system that everybody was using but then due to some legal problems that the guy who wrote the riser file system got into everybody pretty much abandoned it and started using EXT 3 & 4 instead now be aware that before you can use the make riser FS command to create a riser file system on a partition you do need to have the riser FS utils package installed on your system for example if I wanted to create a riser file system on a partition within a fedora system I would use the yum command to install the riser FS - utils package once done you can then create a riser file system on a partition in your Linux system to do this you run the make riser FS command and then specify the device file for the petition you want to create the filesystem on in this case /dev /s DB 1 and by the way if you don't have this package installed you can still create a riser filesystem with with the make FS command you just specify riser FS with the - T option with make FS and you can still accomplish the same thing you can see here that as the filesystem is created the default values for make riser FS are used you can customize these parameters if you want - like we did with make FS you can go ahead and look at the make riser FS utilities man page to see what these parameters are usually my experience has been however that these default parameters work really well because just like make FS make riser FS will determine what the best parameters probably should be based upon the size of the partition and the file system that you're creating now in addition to creating ext 2 3 and 4 as well as riser partitions you can also use the make FS command to create XFS file systems the XFS file system was originally created by Silicon Graphics and it's a very fast very flexible file system and it's been ported over to run on Linux now be aware that before you can create an XFS filesystem XFS support has to be added to the Linux kernel now this is done default during the installation of some distributions like fedora but it's not included with many other distributions two key ones I can think of right off the top of my head or open SUSE and bun two they do not support XFS by default now in addition to creating Linux file systems with the make FS command you can also create non Linux file systems with the make EFS command for example you could create a fat partition or even an NTFS partition to create a fat partition which would be readable between Linux and a Windows system you use the - TV fat option with the make FS command likewise you could even create an NTFS file system on a partition you use - T NTFS that's it for this lesson in this lesson we discussed how to create file systems on Linux partitions first we discussed the role and function of a filesystem then we looked at using the make FS command to make ext2 ext3 and ext4 file systems we also looked at the make riser FS command to make riser file systems and then we ended this lesson by discussing how you can use make efest to create non Linux file systems such as fat or NTFS
Info
Channel: The Linux Man
Views: 12,247
Rating: 4.8814816 out of 5
Keywords: Linux
Id: lLPlQ0ICSSI
Channel Id: undefined
Length: 10min 50sec (650 seconds)
Published: Thu Nov 24 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.