Fdisk
fdisk fdisk: bad usage Try 'fdisk --help' for more information.
fdisk -l
fdisk -l /dev/sda Disk /dev/sda: 14.9 GiB, 15931539456 bytes, 31116288 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/sda1 8192 31116287 31108096 14.9G c W95 FAT32 (LBA)
Create two partitions
Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): First sector (2048-31116287, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-31116287, default 31116287): +64M Created a new partition 1 of type 'Linux' and of size 64 MiB.
Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): e Partition number (2-4, default 2): First sector (133120-31116287, default 133120): Last sector, +sectors or +size{K,M,G,T,P} (133120-31116287, default 31116287): Created a new partition 2 of type 'Extended' and of size 14.8 GiB.
Verify:
Command (m for help): p Disk /dev/sda: 14.9 GiB, 15931539456 bytes, 31116288 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 133119 131072 64M 83 Linux /dev/sda2 133120 31116287 30983168 14.8G 5 Extended
Change partition type
Related commands
See also
- gdisk
- Block devices, partition, GUID Partition Table (GPT),
fdisk
,parted
,Kpartx
, partition,/proc/partitions
,blockdev, mkfs, partprobe
,diskpart (Windows)
,fdisk -l /dev/nbd0
- Block devices:
blkid
(UUID),lshw -class disk
,hwinfo --disk
,udevadm
,rescan-scsi-bus.sh
,LUN
,hdparm
,findfs
, Add a new disk lsblk
,pvscan
lspci
,lsscsi
,smartctl
,fdisk
,parted
,Kpartx
,pvdiplay
,pvs
,udisksctl
,/dev/sd, nvme list
- LUN PV
Advertising: