Skip to content

Instantly share code, notes, and snippets.

@sergev
Created January 10, 2016 00:34
Show Gist options
  • Save sergev/5c47942d8e20f32bbcbe to your computer and use it in GitHub Desktop.
Save sergev/5c47942d8e20f32bbcbe to your computer and use it in GitHub Desktop.
How to create Linux partition table on SD card
$ sudo fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xabddd346.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-31291391, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-31291391, default 31291391): +14.5G
Created a new partition 1 of type 'Linux' and of size 14.5 GiB.
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2-4, default 2):
First sector (30386176-31291391, default 30386176):
Last sector, +sectors or +size{K,M,G,T,P} (30386176-31291391, default 31291391):
Created a new partition 2 of type 'Linux' and of size 442 MiB.
Command (m for help): t
Partition number (1,2, default 2):
Partition type (type L to list all types): 82
Changed type of partition 'Linux' to 'Linux swap / Solaris'.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
$ _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment