sfdisk (util-linux-ng 2.13.1)

sfdisk [options] device ...

device: /dev/hda or /dev/sda or /dev/sda1

Runs interactivly if no input is specifed
accepting :

start,size,ID,bootflag, C,H,S C,H S

ID is xx or L aka 83, S aka 82, E aka 5 or X aka 85
bootflag is * or -

-l
--list
list partitions of each device
-x
--show-extended
also list extended partitions on output or expect descriptors for them on input
-V
--verify
Verify partitions of each device
-uS, -uB, -uC, -uM accept/report in units of sectors/blocks/cylinders/MB
-d
--dump
list partitions in a format suitable for later inputA

sfdisk -x -d /dev/hda > hda.090704.dmp

sfdisk -x /dev/hda < hda.090704.dmp

-s
--show-size
list size of a partition or disk in blocks
-n do not write to disk
-T
--list-types
list the known partition types
-D
--DOS
for DOS-compatibility: waste a little space
-R
--re-read
make kernel reread partition table
-O file save the sectors that will be overwritten to file
-I file restore these sectors again
-c
--id
display or change partition ID
-N# change only the partition with number #

sfdisk /dev/hdb -N5
,,,*

will make the 5th partition active

-g
--show-geometry   
display the kernel's idea of the geometry

/dev/sda: 9039 cylinders, 255 heads, 63 sectors/track

-G
--show-pt-geometry
display geometry determined from the partition table
includes warnings if any

Warning: extended partitino does not start at a cylinder boundary
DOS and Linux will interpret the contents differently
/dev/sda: 9039 cylinders, 255 heads, 63 sectors/track

-L
--Linux
do not complain about things irrelevant for Linux
-q
--quiet
suppress warning messages You can override the detected geometry using:
-C#
--cylinders #
set the number of cylinders to use
-H#
--heads #
set the number of heads to use
-S#
--sectors #
set the number of sectors to use You can disable all consistency checking with:
-f
--force
do what I say, even if it is stupid

Needed if sfdisk complains:
I don't like these partitions - nothing changed.

-v
--version
-?
--help]:


List of RAID 0 disk

Disk /dev/sda: 19457 cylinders, 255 heads, 63 sectors/track

Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+    729     730-   5863693+   7  HPFS/NTFS
/dev/sda2        730    1494     765    6144862+   7  HPFS/NTFS
/dev/sda3       1495    5000    3506   28161945   17  Hidden HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda4       5001   19456   14456  116117820    f  W95 Ext'd (LBA)
/dev/sda5       5001+   5510     510-   4096543+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda6       5511+   5892     382-   3068383+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda7       5893+   5994     102-    819283+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda8       5995+   6077      83-    666666    7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda9       6078+   7352    1275-  10241406    7  HPFS/NTFS
/dev/sda10      7353+   7548     196-   1574338+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda11      7549+   9078    1530-  12289693+   c  W95 FAT32 (LBA)
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda12      9079+  19456   10378-  83361253+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)

Disk /dev/sdb: 19457 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1   *      0+    729     730-   5863693+   7  HPFS/NTFS
/dev/sdb2        730    1494     765    6144862+   7  HPFS/NTFS
/dev/sdb3       1495    5000    3506   28161945   17  Hidden HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sdb4       5001   19456   14456  116117820    f  W95 Ext'd (LBA)
/dev/sdb5       5001+   5510     510-   4096543+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sdb6       5511+   5892     382-   3068383+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sdb7       5893+   5994     102-    819283+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sdb8       5995+   6077      83-    666666    7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sdb9       6078+   7352    1275-  10241406    7  HPFS/NTFS
/dev/sdb10      7353+   7548     196-   1574338+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sdb11      7549+   9078    1530-  12289693+   c  W95 FAT32 (LBA)
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sdb12      9079+  19456   10378-  83361253+   7  HPFS/NTFS
		start: (c,h,s) expected (1023,254,63) found (1023,1,1)


dump format

# partition table of /dev/sda unit: sectors /dev/sda1 : start= 63, size= 11727387, Id= 7, bootable /dev/sda2 : start= 11727450, size= 12289725, Id= 7 /dev/sda3 : start= 24017175, size= 56323890, Id=17 /dev/sda4 : start= 80341065, size=232235640, Id= f /dev/sda5 : start= 80341128, size= 8193087, Id= 7 /dev/sda6 : start= 88534278, size= 6136767, Id= 7 /dev/sda7 : start= 94671108, size= 1638567, Id= 7 /dev/sda8 : start= 96309738, size= 1333332, Id= 7 /dev/sda9 : start= 97643133, size= 20482812, Id= 7 /dev/sda10: start=118126008, size= 3148677, Id= 7 /dev/sda11: start=121274748, size= 24579387, Id= c /dev/sda12: start=145854198, size=166722507, Id= 7


Known partition types

 0  Empty
 1  FAT12
 2  XENIX root
 3  XENIX usr
 4  FAT16 <32M
 5  Extended
 6  FAT16
 7  HPFS/NTFS
 8  AIX
 9  AIX bootable
 a  OS/2 Boot Manager
 b  W95 FAT32
 c  W95 FAT32 (LBA)
 e  W95 FAT16 (LBA)
 f  W95 Ext'd (LBA)
10  OPUS
11  Hidden FAT12
12  Compaq diagnostics
14  Hidden FAT16 <32M
16  Hidden FAT16
17  Hidden HPFS/NTFS
18  AST SmartSleep
1b  Hidden W95 FAT32
1c  Hidden W95 FAT32 (LBA)
1e  Hidden W95 FAT16 (LBA)
24  NEC DOS
39  Plan 9
3c  PartitionMagic recovery
40  Venix 80286
41  PPC PReP Boot
42  SFS
4d  QNX4.x
4e  QNX4.x 2nd part
4f  QNX4.x 3rd part
50  OnTrack DM
51  OnTrack DM6 Aux1
52  CP/M
53  OnTrack DM6 Aux3
54  OnTrackDM6
55  EZ-Drive
56  Golden Bow
5c  Priam Edisk
61  SpeedStor
63  GNU HURD or SysV
64  Novell Netware 286
65  Novell Netware 386
70  DiskSecure Multi-Boot
75  PC/IX
80  Old Minix
81  Minix / old Linux
82  Linux swap / Solaris
83  Linux
84  OS/2 hidden C: drive
85  Linux extended
86  NTFS volume set
87  NTFS volume set
88  Linux plaintext
8e  Linux LVM
93  Amoeba
94  Amoeba BBT
9f  BSD/OS
a0  IBM Thinkpad hibernation
a5  FreeBSD
a6  OpenBSD
a7  NeXTSTEP
a8  Darwin UFS
a9  NetBSD
ab  Darwin boot
b7  BSDI fs
b8  BSDI swap
bb  Boot Wizard hidden
be  Solaris boot
bf  Solaris
c1  DRDOS/sec (FAT-12)
c4  DRDOS/sec (FAT-16 < 32M)
c6  DRDOS/sec (FAT-16)
c7  Syrinx
da  Non-FS data
db  CP/M / CTOS / ...
de  Dell Utility
df  BootIt
e1  DOS access
e3  DOS R/O
e4  SpeedStor
eb  BeOS fs
ee  GPT
ef  EFI (FAT-12/16/32)
f0  Linux/PA-RISC boot
f1  SpeedStor
f4  SpeedStor
f2  DOS secondary
fb  VMware VMFS
fc  VMware VMKCORE
fd  Linux raid autodetect
fe  LANstep
ff  BBT

See
fdisk, cfdisk, Ranish Partition Manager