<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Fdisk_%26_Gdisk</id>
	<title>Fdisk &amp; Gdisk - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Fdisk_%26_Gdisk"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Fdisk_%26_Gdisk&amp;action=history"/>
	<updated>2026-05-15T09:15:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Fdisk_%26_Gdisk&amp;diff=76&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot;If you do not know whether the VM uses MBR or GPT partitions, log into the VM as root and enter one of the following commands.  * **fdisk -l /dev/xvda** - For MBR partitions, the operating system will be shown in the Disklabel type field.      # fdisk -l /dev/xvda       Welcome to fdisk (util-linux 2.27.1).     Changes will remain in memory only, until you decide to write them.     Be careful before using the write command.       Command (m for help): p     Disk /dev/xvd...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Fdisk_%26_Gdisk&amp;diff=76&amp;oldid=prev"/>
		<updated>2024-08-27T00:15:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;If you do not know whether the VM uses MBR or GPT partitions, log into the VM as root and enter one of the following commands.  * **fdisk -l /dev/xvda** - For MBR partitions, the operating system will be shown in the Disklabel type field.      # fdisk -l /dev/xvda       Welcome to fdisk (util-linux 2.27.1).     Changes will remain in memory only, until you decide to write them.     Be careful before using the write command.       Command (m for help): p     Disk /dev/xvd...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;If you do not know whether the VM uses MBR or GPT partitions, log into the VM as root and enter one of the following commands.&lt;br /&gt;
&lt;br /&gt;
* **fdisk -l /dev/xvda** - For MBR partitions, the operating system will be shown in the Disklabel type field.&lt;br /&gt;
&lt;br /&gt;
    # fdisk -l /dev/xvda&lt;br /&gt;
 &lt;br /&gt;
    Welcome to fdisk (util-linux 2.27.1).&lt;br /&gt;
    Changes will remain in memory only, until you decide to write them.&lt;br /&gt;
    Be careful before using the write command.&lt;br /&gt;
 &lt;br /&gt;
    Command (m for help): p&lt;br /&gt;
    Disk /dev/xvda: 9 GiB, 9663676416 bytes, 18874368 sectors&lt;br /&gt;
    Units: sectors of 1 * 512 = 512 bytes&lt;br /&gt;
    Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
    I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
    Disklabel type: dos&lt;br /&gt;
    Disk identifier: 0xe5c7298c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* **gdisk -l /dev/xvda** - For GPT partitions, the GPT field in the Partition Label Scan section will display &amp;quot;present&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
 # gdisk -l /dev/xvda &lt;br /&gt;
  &lt;br /&gt;
 GPT fdisk (gdisk) version 0.8.6&lt;br /&gt;
 Partition table scan:&lt;br /&gt;
   MBR: protective&lt;br /&gt;
   BSD: not present&lt;br /&gt;
   APM: not present&lt;br /&gt;
   GPT: present&lt;br /&gt;
 &lt;br /&gt;
 Found valid GPT with protective MBR; using GPT.&lt;br /&gt;
&lt;br /&gt;
The Protective MBR protects GUID Partition Table disks from previously-released MBR disk tools such as Microsoft MS-DOS FDISK or Microsoft Windows NT Disk Administrator. These tools are not aware of GUID Partition Table and do not know how to properly access a GUID Partition Table disk.&lt;br /&gt;
&lt;br /&gt;
====How to create extended partition using fdisk====&lt;br /&gt;
----&lt;br /&gt;
https://www.thegeekdiary.com/linux-unix-how-to-create-extended-partition-using-fdisk/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this if you just attached a /dev/xvdb disk and you want to make /dev/xvdb1 available:&lt;br /&gt;
 $ fdisk /dev/nvme1n1p1&lt;br /&gt;
 Disk /dev/nvme1n1p1: 205.0 GB, 204998951936 bytes, 400388578 sectors&lt;br /&gt;
 Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
 Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
 I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
 Disk label type: gpt&lt;br /&gt;
 Disk identifier: 8ADED94B-5295-4B97-BCB4-74DB3348EB1E&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #         Start          End    Size  Type            Name&lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): m&lt;br /&gt;
 Command action&lt;br /&gt;
    d   delete a partition&lt;br /&gt;
    g   create a new empty GPT partition table&lt;br /&gt;
    G   create an IRIX (SGI) partition table&lt;br /&gt;
    l   list known partition types&lt;br /&gt;
    m   print this menu&lt;br /&gt;
    n   add a new partition&lt;br /&gt;
    o   create a new empty DOS partition table&lt;br /&gt;
    p   print the partition table&lt;br /&gt;
    q   quit without saving changes&lt;br /&gt;
    s   create a new empty Sun disklabel&lt;br /&gt;
    t   change a partition&amp;#039;s system id&lt;br /&gt;
    v   verify the partition table&lt;br /&gt;
    w   write table to disk and exit&lt;br /&gt;
    x   extra functionality (experts only) &lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): n&lt;br /&gt;
 Partition type:&lt;br /&gt;
    p   primary (1 primary, 0 extended, 3 free)&lt;br /&gt;
    e   extended&lt;br /&gt;
 Select (default p): p&lt;br /&gt;
 Partition number (1-4, default 1):&lt;br /&gt;
 First sector (2048-400388544, default 2048):&lt;br /&gt;
 Last sector, +sectors or +size{K,M,G,T,P} (2048-400388544, default 400388544): +20G&lt;br /&gt;
 Created partition 1&lt;br /&gt;
  &lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): n&lt;br /&gt;
 Partition number (2-4, default 2):&lt;br /&gt;
 First sector (41945088-400388544, default 41945088):&lt;br /&gt;
 Last sector, +sectors or +size{K,M,G,T,P} (41945088-400388544, default 400388544): +30G&lt;br /&gt;
 Created partition 2 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): w&lt;br /&gt;
 The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
* https://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux/&lt;br /&gt;
** specify the last sector of the partition on the disk. If you want to use up all available space after the initial sector, just press Enter. You can also specify a specific size, such as +5G for a five gigabyte partition or +512M for a 512 megabyte partition. If you don’t specify a unit after the + sign, fdisk uses sectors as the unit. For example, +10000 results in the end of the partition being 10000 sectors after its beginning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating a Boot Partition on the AWS Root Volume====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://docs.hytrust.com/DataControl/4.3/Online/Content/Books/Admin-Guide/Linux-Root-Swap-Drive-Encryption/Creating-Boot-Partition-on-AWS-Root-Volume-Admin-Guide.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [root@ip-172-31-94-208 ec2-user]# gdisk /dev/xvda&lt;br /&gt;
 GPT fdisk (gdisk) version 0.8.10 &lt;br /&gt;
 &lt;br /&gt;
 Partition table scan:&lt;br /&gt;
   MBR: protective&lt;br /&gt;
   BSD: not present&lt;br /&gt;
   APM: not present&lt;br /&gt;
   GPT: present &lt;br /&gt;
 &lt;br /&gt;
 Found valid GPT with protective MBR; using GPT. &lt;br /&gt;
 &lt;br /&gt;
 Command (? for help): x &lt;br /&gt;
 &lt;br /&gt;
 Expert command (? for help): e&lt;br /&gt;
 Relocating backup data structures to the end of the disk  &lt;br /&gt;
 &lt;br /&gt;
 Expert command (? for help): m &lt;br /&gt;
 &lt;br /&gt;
 Command (? for help): p&lt;br /&gt;
 Disk /dev/xvda: 23068672 sectors, 11.0 GiB&lt;br /&gt;
 Logical sector size: 512 bytes&lt;br /&gt;
 Disk identifier (GUID): E5D51EAD-EA94-46B7-8EF5-CE2BBB0BF57C&lt;br /&gt;
 Partition table holds up to 128 entries&lt;br /&gt;
 First usable sector is 34, last usable sector is 23068638&lt;br /&gt;
 Partitions will be aligned on 2048-sector boundaries&lt;br /&gt;
 Total free space is 2099166 sectors (1.0 GiB)&lt;br /&gt;
 &lt;br /&gt;
 Number  Start (sector)    End (sector)  Size       Code  Name&lt;br /&gt;
    1            2048        20971486   10.0 GiB    0700   &lt;br /&gt;
 &lt;br /&gt;
 Command (? for help): n&lt;br /&gt;
 Partition number (2-128, default 2): &lt;br /&gt;
 First sector (34-23068638, default = 20971520) or {+-}size{KMGTP}: &lt;br /&gt;
 Last sector (20971520-23068638, default = 23068638) or {+-}size{KMGTP}: +250M&lt;br /&gt;
 Current type is &amp;#039;Linux filesystem&amp;#039;&lt;br /&gt;
 Hex code or GUID (L to show codes, Enter = 8300): 0700&lt;br /&gt;
 Changed type of partition to &amp;#039;Microsoft basic data&amp;#039; &lt;br /&gt;
 &lt;br /&gt;
 Command (? for help): c&lt;br /&gt;
 Partition number (1-2): 2&lt;br /&gt;
 Enter name:  &lt;br /&gt;
  &lt;br /&gt;
 Command (? for help): p&lt;br /&gt;
 Disk /dev/xvda: 23068672 sectors, 11.0 GiB&lt;br /&gt;
 Logical sector size: 512 bytes&lt;br /&gt;
 Disk identifier (GUID): E5D51EAD-EA94-46B7-8EF5-CE2BBB0BF57C&lt;br /&gt;
 Partition table holds up to 128 entries&lt;br /&gt;
 First usable sector is 34, last usable sector is 23068638&lt;br /&gt;
 Partitions will be aligned on 2048-sector boundaries&lt;br /&gt;
 Total free space is 1587166 sectors (775.0 MiB)&lt;br /&gt;
 &lt;br /&gt;
 Number  Start (sector)    End (sector)  Size       Code  Name&lt;br /&gt;
    1            2048        20971486   10.0 GiB    0700  &lt;br /&gt;
    2        20971520        21483519   250.0 MiB   0700   &lt;br /&gt;
 &lt;br /&gt;
 Command (? for help): w&lt;br /&gt;
 &lt;br /&gt;
 Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING&lt;br /&gt;
 PARTITIONS!! &lt;br /&gt;
 &lt;br /&gt;
 Do you want to proceed? (Y/N): y&lt;br /&gt;
 OK; writing new GUID partition table (GPT) to /dev/xvda.&lt;br /&gt;
 Warning: The kernel is still using the old partition table.&lt;br /&gt;
 The new table will be used at the next reboot.&lt;br /&gt;
 The operation has completed successfully.&lt;br /&gt;
 [root@ip-172-31-94-208 ec2-user]# reboot &lt;br /&gt;
 &lt;br /&gt;
 Broadcast message from ec2-user@ip-172-31-94-208.ec2.internal&lt;br /&gt;
 	(/dev/pts/0) at 22:42 ...&lt;br /&gt;
 &lt;br /&gt;
 The system is going down for reboot NOW!&lt;br /&gt;
 [root@ip-172-31-94-208 ec2-user]# Connection to 54.174.120.229 closed by remote host.&lt;br /&gt;
 Connection to 54.174.120.229 closed.&lt;br /&gt;
 38f9d3587610:~ ardikas$ ssh -i .ssh/ec2_nva_key.pem ec2-user@54.174.120.229&lt;br /&gt;
 ssh: connect to host 54.174.120.229 port 22: Operation timed out&lt;br /&gt;
 38f9d3587610:~ ardikas$ ssh -i .ssh/ec2_nva_key.pem ec2-user@54.174.120.229&lt;br /&gt;
 Last login: Wed Jul 13 22:38:39 2022 from 72-21-198-65.amazon.com&lt;br /&gt;
 [ec2-user@ip-172-31-94-208 ~]$ lsblk&lt;br /&gt;
 NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
 xvda    202:0    0   11G  0 disk &lt;br /&gt;
 ├─xvda1 202:1    0   10G  0 part /&lt;br /&gt;
 └─xvda2 202:2    0  250M  0 part&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>