{"id":3642,"date":"2017-04-03T12:35:47","date_gmt":"2017-04-03T07:05:47","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=3642"},"modified":"2017-04-03T12:35:47","modified_gmt":"2017-04-03T07:05:47","slug":"fdisk-how-to-label-a-partition","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/fdisk-how-to-label-a-partition\/","title":{"rendered":"fdisk : how to label a partition?"},"content":{"rendered":"<h3 id=\"fdisk\"><span style=\"color: #ff6600;\"><b>fdisk<\/b><\/span><\/h3>\n<ul>\n<li>fdisk stands (<b>for \u201cfixed disk or format disk\u201c) <\/b>is an most commonly used command-line based disk manipulation utility for a Linux\/Unix systems.<\/li>\n<li>With the help of fdisk command you can view, create, resize, delete, change, copy and move partitions on a hard drive using its own user friendly text based menu driven interface.<\/li>\n<li>This tool is very useful in terms of creating space for new partitions, organising space for new drives, re-organising an old drives and copying or moving data to new disks.<\/li>\n<li>It allows you to create a maximum of four new primary partition and number of logical (extended) partitions, based on size of the hard disk you have in your system.<\/li>\n<\/ul>\n<h4 id=\"view-all-disk-partitions-in-linux\"><span style=\"color: #993300;\"><b>View all Disk Partitions in Linux:<\/b><\/span><\/h4>\n<ul>\n<li>The following basic command list all existing disk partition on your system.<\/li>\n<li>The \u2018-l\u2018 argument stand for (listing all partitions) is used with fdisk command to view all available partitions on Linux. The partitions are displayed by their device\u2019s names.<\/li>\n<li>For example: \/dev\/sda, \/dev\/sdb or \/dev\/sdc.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">[root@tecmint.com ~]# fdisk -l<br\/>Disk \/dev\/sda: 637.8 GB, 637802643456 bytes<br\/>255 heads, 63 sectors\/track, 77541 cylinders<br\/>Units = cylinders of 16065 * 512 = 8225280 bytes<br\/>Device Boot      Start         End      Blocks   Id  System<br\/>\/dev\/sda1   *           1          13      104391   83  Linux<br\/>\/dev\/sda2              14        2624    20972857+  83  Linux<br\/>\/dev\/sda3            2625        4582    15727635   83  Linux<br\/>\/dev\/sda4            4583       77541   586043167+   5  Extended<br\/>\/dev\/sda5            4583        5887    10482381   83  Linux<br\/>\/dev\/sda6            5888        7192    10482381   83  Linux<br\/>\/dev\/sda7            7193        7845     5245191   83  Linux<br\/>\/dev\/sda8            7846        8367     4192933+  82  Linux swap \/ Solaris<br\/>\/dev\/sda9            8368       77541   555640123+  8e  Linux LVM<\/code><\/pre> <\/div>\n<h4 id=\"view-specific-disk-partition-in-linux\"><span style=\"color: #99cc00;\"><b>View Specific Disk Partition in Linux:<\/b><\/span><\/h4>\n<ul>\n<li>To view all partitions of specific hard disk use the option \u2018-l\u2018 with device name.<\/li>\n<li>For example, the following command will display all disk partitions of device \/dev\/sda.<\/li>\n<li>If you\u2019ve different device names, simple write device name as \/dev\/sdb or \/dev\/sdc.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">[root@tecmint.com ~]# fdisk -l \/dev\/sda<br\/>Disk \/dev\/sda: 637.8 GB, 637802643456 bytes<br\/>255 heads, 63 sectors\/track, 77541 cylinders<br\/>Units = cylinders of 16065 * 512 = 8225280 bytes<br\/>Device Boot      Start         End      Blocks   Id  System<br\/>\/dev\/sda1   *           1          13      104391   83  Linux<br\/>\/dev\/sda2              14        2624    20972857+  83  Linux<br\/>\/dev\/sda3            2625        4582    15727635   83  Linux<br\/>\/dev\/sda4            4583       77541   586043167+   5  Extended<br\/>\/dev\/sda5            4583        5887    10482381   83  Linux<br\/>\/dev\/sda6            5888        7192    10482381   83  Linux<br\/>\/dev\/sda7            7193        7845     5245191   83  Linux<br\/>\/dev\/sda8            7846        8367     4192933+  82  Linux swap \/ Solaris<br\/>\/dev\/sda9            8368       77541   555640123+  8e  Linux LVM<\/code><\/pre> <\/div>\n<h4 id=\"print-all-partition-table-in-linux\"><span style=\"color: #ff6600;\"><strong>Print all Partition Table in Linux<\/strong><\/span><\/h4>\n<ul>\n<li>To print all partition table of hard disk, you must be on command mode of specific hard disk say \/dev\/sda.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">[root@tecmint ~]# fdisk \/dev\/sda<\/code><\/pre> <\/div>\n<ul>\n<li>From the command mode, enter \u2018p\u2018 instead of \u2018m\u2018 as we did earlier. As we enter \u2018p\u2018, it will print the specific \/dev\/sda partition table.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">Command (m for help): p<br\/>Disk \/dev\/sda: 637.8 GB, 637802643456 bytes<br\/>255 heads, 63 sectors\/track, 77541 cylinders<br\/>Units = cylinders of 16065 * 512 = 8225280 bytes<br\/>Device Boot      Start         End      Blocks   Id  System<br\/>\/dev\/sda1   *           1          13      104391   83  Linux<br\/>\/dev\/sda2              14        2624    20972857+  83  Linux<br\/>\/dev\/sda3            2625        4582    15727635   83  Linux<br\/>\/dev\/sda4            4583       77541   586043167+   5  Extended<br\/>\/dev\/sda5            4583        5887    10482381   83  Linux<br\/>\/dev\/sda6            5888        7192    10482381   83  Linux<br\/>\/dev\/sda7            7193        7845     5245191   83  Linux<br\/>\/dev\/sda8            7846        8367     4192933+  82  Linux swap \/ Solaris<br\/>\/dev\/sda9            8368       77541   555640123+  8e  Linux LVM<br\/>Command (m for help):<\/code><\/pre> <\/div>\n<h4 id=\"how-to-format-a-partition-in-linux\"><span style=\"color: #99cc00;\"><b> How to Format a Partition in Linux:<\/b><\/span><\/h4>\n<ul>\n<li>After the new partition is created, don\u2019t skip to format the newly created partition using \u2018mkfs\u2018 command.<\/li>\n<li>Type the following command in the terminal to format a partition. Here \/dev\/sda4 is my newly created partition.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">[root@tecmint ~]# mkfs.ext4 \/dev\/sda4<\/code><\/pre> <\/div>\n<h4 id=\"how-to-check-size-of-a-partition-in-linux\"><span style=\"color: #993300;\"><b> How to Check Size of a Partition in Linux:<\/b><\/span><\/h4>\n<ul>\n<li>After formatting new partition, check the size of that partition using flag \u2018s\u2018 (displays size in blocks) with fdisk command. This way you can check size of any specific device.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">[root@tecmint ~]# fdisk -s \/dev\/sda2<br\/>5194304<\/code><\/pre> <\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>fdisk stands (for \u201cfixed disk or format disk\u201c) is an most commonly used command-line based disk manipulation utility for a Linux\/Unix systems.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1699],"tags":[6869,6873,6856,6861,6859,6866,6875,6851,6848,6858,6841,6839,6842,6838,6847,6867,6852,6872,6854,6844,6853,6860,6832,6836,6833,6835,6850,6863,6865,6846,6864,6868,6870,6876,6845,6849,6855,6857,6834,6837,6874,6877,6871,6862,6840,6843],"class_list":["post-3642","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ubuntu-how-to-change-the-volume-label-disk-name","tag-change-disk-label-linux","tag-create-partition-fdisk","tag-delete-partition-fdisk","tag-extended-fdisk","tag-fdisk-alternative","tag-fdisk-change-disk-label-type","tag-fdisk-change-partition-type","tag-fdisk-command-linux","tag-fdisk-command-windows-7","tag-fdisk-create-fat32-partition","tag-fdisk-create-new-partition","tag-fdisk-create-ntfs-partition","tag-fdisk-create-partition","tag-fdisk-delete-partition","tag-fdisk-expand-partition","tag-fdisk-extend-partition","tag-fdisk-for-dos-partition","tag-fdisk-format-partition","tag-fdisk-linux","tag-fdisk-linux-command","tag-fdisk-options","tag-fdisk-partition","tag-fdisk-partition-loschen","tag-fdisk-partition-table","tag-fdisk-partition-types","tag-fdisk-remove-partition","tag-fdisk-tool","tag-fdisk-type","tag-fdisk-windows","tag-format-disk-fdisk","tag-how-to-change-linux-partition-label-names-on-ext4-ext3-ext2","tag-label-a-linux-partition","tag-linux-change-fat32-label","tag-linux-fdisk","tag-linux-fdisk-command","tag-linux-fdisk-delete-partition","tag-linux-fdisk-format","tag-linux-fdisk-partition","tag-linux-fdisk-partition-types","tag-linux-label-partition-ext4","tag-linux-partition-label","tag-re-fdisk-and-labels","tag-sfdisk-copy-partition-table","tag-sfdisk-create-partition","tag-sfdisk-create-partition-example"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/3642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=3642"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/3642\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=3642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=3642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=3642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}