{"id":478,"date":"2020-08-18T19:23:47","date_gmt":"2020-08-18T20:23:47","guid":{"rendered":"http:\/\/www.linux-tutorial.info\/?page_id=77"},"modified":"2020-08-22T19:26:01","modified_gmt":"2020-08-22T20:26:01","slug":"this-is-the-page-title-toplevel-311","status":"publish","type":"page","link":"http:\/\/www.linux-tutorial.info\/?page_id=478","title":{"rendered":"Installing the File System"},"content":{"rendered":"\n<title>Installing the Filesystem<\/title>\n<question id=\"\" type=\"tf\" text=\"Creating a new filesystem on Linux is essentially the same as partitioning under Windows.\" \/>\n<p>\nWhen doing a fresh install there is generall very little that you need to do\nin regard to installing a filesystem. Most of the work is done for you.\nAll you really need to do is choose the filesystem(s) you want to use.\nHowever, for many people (newbies and experienced users alike), which file\nsystem to choose it not always clear-cut.\n<\/p>\n<p>\nIn the <site id=\"342\">section on supported filesystems<\/site>, we talk about\nsome of the various filesystem types and what things to consider when choosing\none over the other.\n<\/p>\n<question id=\"\" type=\"mc\" text=\"If you are going to have a lot of small files, what should you do when creating a filesystem?\" \/>\n<concept id=\"\" description=\"If you expect that you are going to have a large number of files, you should increase the number of inodes.\" \/>\n<p>\nIf you expect that you are going to have a large number of files on your\nsystems (like hundreds of thousands or millions), then you will need to increase\nthe number of inodes. Basically, inodes are pointers to the data on the disk,\nas well as contain information about the file such as the file owner, permissions\nand so on. In most cases, you are limited by the number of <glossary term=\"inode\">inodes<\/glossary> which are\ncreated when the filesystem is created. Once you run out, you need to either\nmove the files to another filesystem, or backup the data, recreate the filesystem\nthen restore the tape. Both are sometimes not possible. Keep in mind,\nhowever, that for most home users, the defult number of inodes\nis usually enough.In the <site id=\"96\">section on the disk layout<\/site>\nwe talk about inodes in detail.\n<\/p>\n<question id=\"\" type=\"mc\" text=\"What command is typically used to create a new file system?\" \/>\n<p>\nGenerically, filesystems are created using using the <command>mkfs<\/command>\ncommand. One of the options it takes is the filesystem type. The basically\ntells mkfs to start the real program which then creates the filesystem.\nFor example, the <command>mke2fs<\/command> is called when create an ext2fs.\nWhen calling\nmkfs, you typically have few options. So if you need to specify the\nnumber of <glossary term=\"inode\">inodes<\/glossary>, you will need to start the real program by hand. In the case of the <command>ext2fs<\/command>,\nyou can use the <keyinput>-i<\/keyinput> option to specify\nthe number of inodes. Check out the appropriate man-page for details.\n<\/p>\n<p>\nOne interesting thing about the ReiserFS is that inode are allocated\ndynamically. That means you will only run out of indode when you run out of\nspace on the disk.\n<\/p>\n<p>\nExamples of <command>mkfs<\/command> commands are:\n<p>\n<table>\n  <tbody>\n    <tr><td>Filesystem<\/td><td>Command<\/td><\/tr>\n      <tr><td>EXT2 FS<\/td><td>mkfs.ext2 <\/td><\/tr>\n      <tr><td>EXT4 FS<\/td><td>mkfs.ext3 <\/td><\/tr>\n      <tr><td>SCO BFS<\/td><td>mkfs.bfs <\/td><\/tr>\n      <tr><td>Minix FS<\/td><td>mkfs.minix <\/td><\/tr>\n      <tr><td>DOS (FAT) FS <\/td><td>mkfs.msdos <\/td><\/tr>\n      <tr><td>Virtual FAT FS<\/td><td>mkfs.vfat <\/td><\/tr>\n      <tr><td>XFS<\/td><td>mkfs.xfs <\/td><\/tr>\n      <tr><td>XIA FS<\/td><td>mkfs.xiafs <\/td><\/tr>\n  <\/tbody>\n<\/table>\n<p>\nA list of supported filesystem types can be found in the <site id=\"243\">here<\/site>.\nand the <site id=\"97\">section on file system tools<\/site>.\n<\/p>\n<p>\nBy default all of these reside in the <directory>\/sbin<\/directory> directory. If we do an <keyinput>ls -li<\/keyinput> to get the <glossary>inode<\/glossary> number, as well,\nwe end up with something like this:\n<\/p>\n<screenoutput>\n 481394 -rwxr-xr-x    1 root     root         5124 Sep 23  2003 \/sbin\/mkfs\n 481395 -rwxr-xr-x    1 root     root         7744 Sep 23  2003 \/sbin\/mkfs.bfs\n 481396 -rwxr-xr-x    1 root     root        15196 Sep 23  2003 \/sbin\/mkfs.cramfs\n 480620 -rwxr-xr-x    3 root     root        31252 Sep 23  2003 \/sbin\/mkfs.ext2\n 480620 -rwxr-xr-x    3 root     root        31252 Sep 23  2003 \/sbin\/mkfs.ext3\n 480930 -rwxr-xr-x    2 root     root        61691 Sep 23  2003 \/sbin\/mkfs.jfs\n 481397 -rwxr-xr-x    1 root     root        15488 Sep 23  2003 \/sbin\/mkfs.minix\n 480434 lrwxrwxrwx    1 root     root            7 Dec 28 10:43 \/sbin\/mkfs.msdos -> mkdosfs\n 480413 -rwxr-xr-x    2 root     root       142344 Sep 23  2003 \/sbin\/mkfs.reiserfs\n 480551 -rwxr-xr-x    1 root     root       342040 Sep 23  2003 \/sbin\/mkfs.xfs\n<\/screenoutput>\n<p>\nNote that both <command>mkfs.ext2<\/command> and <command>mkfs.ext3<\/command> both have the same inode number and are thus the exact same program. This makes sense since the ext3fs is just an extension of the ext3fs.s\n<\/p>\n<p>\nIn it&#8217;s simplest form, you can usually run the appropriate <command>mkfs<\/command>\ncommand and pass it just the name of the partition, without any option. For example,\nif we wanted to create and ext3fs, we could do it like this:\n<\/p>\n<commandexample command=\"mkfs.ext3\">\/sbin\/mkfs.ext3 \/dev\/hda12<\/commandexample>\n<p>\nThis gives us an output like this:\n<\/p>\n<screenoutput>\nmke2fs 1.34 (25-Jul-2003)\nFilesystem label=\nOS type: Linux\nBlock size=4096 (log=2)\nFragment size=4096 (log=2)\n2247744 inodes, 4494175 blocks\n224708 blocks (5.00{3f0b0cf5c640d99e599990c4a720721a04ec3a009b1323dd81fc335ceb655a63}) reserved for the super user\nFirst data block=0\n138 block groups\n32768 blocks per group, 32768 fragments per group\n16288 inodes per group\nSuperblock backups stored on blocks:\n        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,\n        4096000\nWriting inode tables: done\nCreating journal (8192 blocks): done\nWriting superblocks and filesystem accounting information: done\nThis filesystem will be automatically checked every 38 mounts or\n180 days, whichever comes first.  Use tune2fs -c or -i to override.\n<\/screenoutput>\n<p>\nNote that the very first line indicates that the program called is <command>mke2fs<\/command>, although we started it as <command>mkfs.ext3<\/command>. If we were to start it as mkfs.ext2, the output would be the same except that you would not have the line:\n<\/p>\n<screenoutput>\nCreating journal (8192 blocks): done\n<\/screenoutput>\n<p>\nThis is quite simply because the ext2fs is not a journalling filesystem where the ext3fs is. If were ran <command>mkfs.ext2<\/command> a said we wanted a journalling filesystem (using the <keyinput>-j<\/keyinput> option) the output would be the same.\n<\/p>\n<p>\nNote that the program created 10 copied of the superblock. Each being an exact copy of the other. The superblock contains information about the type of file system, its size, how many data blocks there are, the number of free inodes, free space available, and where the inode table is. Detail can be found in the <site id=\"95\">section on disk layout<\/site>.\n<\/p>\nDetails on checking the file system can be found in the <site id=\"97\">section on filesystem tools.<\/site>\n","protected":false},"excerpt":{"rendered":"<p>Installing the Filesystem When doing a fresh install there is generall very little that you need to do in regard to installing a filesystem. Most of the work is done for you. All you really need to do is choose &hellip; <a href=\"http:\/\/www.linux-tutorial.info\/?page_id=478\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-478","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=478"}],"version-history":[{"count":1,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/478\/revisions"}],"predecessor-version":[{"id":585,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/478\/revisions\/585"}],"wp:attachment":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}