{"id":25393,"date":"2017-10-15T18:01:18","date_gmt":"2017-10-15T12:31:18","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=25393"},"modified":"2017-10-15T18:01:18","modified_gmt":"2017-10-15T12:31:18","slug":"15-linux-sfdisk-command-examples-manage-disk-partitions","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/15-linux-sfdisk-command-examples-manage-disk-partitions\/","title":{"rendered":"15 Linux sfdisk Command Examples to Manage Disk Partitions"},"content":{"rendered":"<p>If you are a sysadmin, managing your Linux server\u2019s hard disk partition is a critical task.<\/p>\n<p>In this tutorial, we\u2019ll focus on how to use sfdisk command-line utility to manage your hard disk partitions.<\/p>\n<p>While sfdisk is similar to <a href=\"http:\/\/www.thegeekstuff.com\/2010\/09\/linux-fdisk\" target=\"_blank\" rel=\"noopener\">fdisk<\/a>, there are few partition manipulation activities that are very easy to perform in sfdisk. For example, you can create new partitions in an non-interactive method using sfdisk.<\/p>\n<p>The following sfdisk activities are covered in this tutorial:<br \/>\n<span id=\"more-17484\"><\/span><\/p>\n<ol>\n<li>View Existing Disk Partitions<\/li>\n<li>Change Display Units (Display Size in MB)<\/li>\n<li>Create New Disk Partitions (Interactive Method)<\/li>\n<li>Verify Partition Table Consistency<\/li>\n<li>Display Total Partition Size<\/li>\n<li>Dump Disk Partition Details to Text File<\/li>\n<li>Create New Partitions from Text File (Non-interactive Method)<\/li>\n<li>Display Extended Partition Details<\/li>\n<li>Display Disk Geometry for Debugging<\/li>\n<li>Display All Disk Partition types<\/li>\n<li>Manipulate Only a Single Disk Partition<\/li>\n<li>Dry-run Mode for Verification<\/li>\n<li>Mark a Specific Partition as Bootable<\/li>\n<li>Change Partition Type<\/li>\n<li>Create New Partitions from Shell Script (Non-interactive Method)<\/li>\n<\/ol>\n<h2 id=\"view-existing-disk-partitions\">View Existing Disk Partitions<\/h2>\n<p>Using -l option you can view all your disk partitions. -l stands for list.<\/p>\n<p>By default this will display partitions of all the disks on your systems.<\/p>\n<pre># sfdisk -l\r\n\r\nDisk \/dev\/sda: 1044 cylinders, 255 heads, 63 sectors\/track\r\nUnits: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0\r\n\r\n   Device Boot Start     End   #cyls    #blocks   Id  System\r\n\/dev\/sda1   *      0+   1044-   1045-   8387584   83  Linux\r\n\/dev\/sda2          0       -       0          0    0  Empty\r\n\/dev\/sda3          0       -       0          0    0  Empty\r\n\/dev\/sda4          0       -       0          0    0  Empty\r\n\r\nDisk \/dev\/sdf: 1044 cylinders, 255 heads, 63 sectors\/track\r\n<\/pre>\n[ad type=\u201dbanner\u201d]\n","protected":false},"excerpt":{"rendered":"<p>If you are a sysadmin, managing your Linux server\u2019s hard disk partition is a critical task. In this tutorial, we\u2019ll focus on how to use sfdisk command-line utility to manage your hard disk partitions. While sfdisk is similar to fdisk, there are few partition manipulation activities that are very easy to perform in sfdisk. For [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,83523,1699],"tags":[],"class_list":["post-25393","post","type-post","status-publish","format-standard","hentry","category-coding","category-disk-partitions","category-linux"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/25393","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=25393"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/25393\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=25393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=25393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=25393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}