{"id":213,"date":"2015-07-06T10:57:46","date_gmt":"2015-07-06T10:57:46","guid":{"rendered":"http:\/\/www.howtolearnlinux.com\/?p=213"},"modified":"2018-07-11T03:55:33","modified_gmt":"2018-07-11T03:55:33","slug":"linux-file-system-management","status":"publish","type":"post","link":"http:\/\/shijuvarghese.com\/?p=213","title":{"rendered":"Linux File System Management"},"content":{"rendered":"<p><span style=\"font-family: verdana; font-size: small;\"><b>Disk Druid:<\/b> The only tool used for partitioning management at the time of installation<\/span><\/p>\n<p><span style=\"font-family: verdana; font-size: small;\">Partitioning management utilities available after installation:<\/span><\/p>\n<ul>\n<li>fdisk<\/li>\n<li>parted<\/li>\n<li>sfdisk<\/li>\n<\/ul>\n<p><span style=\"font-family: verdana; font-size: small;\">Total partitions allowed is 63. From the fifth, it will be extended partition.<\/span><\/p>\n<p>A limitation of fdisk is that it will recognize only up to 16 partitions. But we can apply size in MG or even GB.<\/p>\n<p>In &#8220;parted&#8221; tool we can specify size only in cylindrical units.<\/p>\n<p><b># fdisk -l<\/b> : Displays the number of devices and partitions.<\/p>\n<p><b># fdisk \/dev\/sda<\/b> : To create a new partition in sda<\/p>\n<ul>\n<li>n = new partition<\/li>\n<li>p = Primary partition<\/li>\n<li>Leave starting block as default<\/li>\n<li>To create a 5 MB partition, use the value +500M<\/li>\n<li>w = save the partition<\/li>\n<\/ul>\n<p><span style=\"font-family: verdana; font-size: small;\">The partition will be identified only after rebooting the system.<\/span><\/p>\n<p><b># partprobe<\/b> : This is to inform kernal about the new partition without rebooting the system.<\/p>\n<p>The command <i>mkfs<\/i> is used to format a disk<\/p>\n<p><b>File Systems:<\/b><\/p>\n<table border=\"0\" cellspacing=\"3\">\n<tbody>\n<tr>\n<td width=\"200\"><span style=\"font-family: verdana; font-size: small;\">RHL<\/span><\/td>\n<td><span style=\"font-family: verdana; font-size: small;\">ext3 (up to 4 TB)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: verdana; font-size: small;\">RHL<\/span><\/td>\n<td><span style=\"font-family: verdana; font-size: small;\">ext2<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: verdana; font-size: small;\">Other<\/span><\/td>\n<td><span style=\"font-family: verdana; font-size: small;\">reiscnfs<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: verdana; font-size: small;\">SGA<\/span><\/td>\n<td><span style=\"font-family: verdana; font-size: small;\">xfs<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: verdana; font-size: small;\">IBM<\/span><\/td>\n<td><span style=\"font-family: verdana; font-size: small;\">ffs<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>The feature &#8220;journaling&#8221; is supported by ext3<\/p>\n<p><b># mkfs.ext3 \/dev\/sda9<\/b> : Command to format sda9 with ext3 file system<\/p>\n<p><b># df -h <\/b> : Free space in every mounted file system will be displayed<\/p>\n<p>Once formatted the partition could be mounted using the command<br \/>\n<b># mkdir \/temp<\/b><br \/>\n<b># mount \/dev\/sda9 \/temp<\/b><\/p>\n<p><span style=\"font-family: verdana; font-size: small;\">This is only a temporary mounting. For a permanent setup it had to be done using fstab.<\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/star.genuinewebhost.com\/%7Elinuxguru\/www\/images\/rhel_pic3.JPG\" alt=\"\" \/><\/p>\n<p><span style=\"font-family: verdana; font-size: small;\">Each block can be a minimum of 1025 bytes or maximum of 8192 bytes.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: verdana; font-size: small;\">If size of partition &lt;= 530 M , block = 1025 bytes<br \/>\nIf size of partition &gt; 530 M , block = 4096 bytes<\/span><\/p>\n<p>When we create a file, each file will take 1 block. If the size of the file is more than the block size, the next nearest block will also be used.<\/p>\n<p>In ext format, internal fragmentation happens since if a file is less than the block size, the excess portion in the block will not be used.<br \/>\n<img decoding=\"async\" src=\"http:\/\/star.genuinewebhost.com\/%7Elinuxguru\/www\/images\/rhel_pic4.JPG\" alt=\"\" \/><br \/>\nBut external fragmentation, that leaves empty blocks in between used blocks will be avoided in ext format.<br \/>\n<img decoding=\"async\" src=\"http:\/\/star.genuinewebhost.com\/%7Elinuxguru\/www\/images\/rhel_pic5.JPG\" alt=\"\" \/><br \/>\nDue to this choosing the correct block size is good to control internal fragmentation.<\/p>\n<p><span style=\"font-family: verdana; font-size: small;\"><b># mkfs.ext3 -b 1055 \/dev\/sda9<\/b> : Formatting sda9 with a block size of 1055 bytes.<\/span><\/p>\n<p>Note: This will wipe off all the current data in that partition.<\/p>\n<p><b>Inode<\/b> : This is a unique number that identifies each file. The total number of inodes, ie the no of files that could be created is decided at the time of formatting the partition.<\/p>\n<p>Inode 1 &#8211; 10 is reserved. Thus the first files will have inode # 11. Each inode will also contain information about the file stored in it. This data is called metadata which will occupy 128 bytes. Thus each inode should have a minimum of 128 bytes.<\/p>\n<p><b># stat \/etc\/passwd<\/b> : Command to display the statistics of a file.<\/p>\n<p><b># mkfs.ext3 -N 1000 \/dev\/sda9<\/b> : set the maximum number of inode to 1000<br \/>\n<img decoding=\"async\" src=\"http:\/\/star.genuinewebhost.com\/%7Elinuxguru\/www\/images\/rhel_pic6.JPG\" alt=\"\" \/><br \/>\nGroup-1 and group-2, etc are nodes that contains information of a set of nodes.<\/p>\n<p><b># mkfs.ext3 -c<\/b> : To check bad blocks before formatting.<\/p>\n<p><b># mkfs.ext3 -L data \/dev\/hda9<\/b> : Assign a label &#8220;data&#8221; to hda9 while formatting.<\/p>\n<p><b># e2label \/dev\/sda9<\/b> : displays the label of sda9<\/p>\n<p><b># e2label \/dev\/sda9 llc<\/b> : Give a new label to sda9<\/p>\n<p><b># findfs LABEL=llc<\/b> : Find the device that has the label llc.<\/p>\n<p><b>mount \/dev\/sda9 \/opt\/<\/b> and the command <b>mount LABEL=llc \/opt\/ <\/b>does the same function.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Disk Druid: The only tool used for partitioning management at the time of installation Partitioning management utilities available after installation: fdisk parted sfdisk Total partitions <a class=\"mh-excerpt-more\" href=\"http:\/\/shijuvarghese.com\/?p=213\" title=\"Linux File System Management\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":252,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=213"}],"version-history":[{"count":2,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":702,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions\/702"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/media\/252"}],"wp:attachment":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}