id: 12388    nodeId: 12388    type: General    point: 136.0    linkPoint: .0    maker: cella    permission: linkable    made at: 2017.12.18 01:04    edited at: 2017.12.20 12:18
how to partition and format USB memory (or SD card) with ext4 on linux
https://www.tecmint.com/parted-command-to-create-resize-rescue-linux-disk-partitions/
# refere to this page

# to delete previous partition table
$ sudo dd if=/dev/zero of=/dev/sda bs=1024 count=100

# find the device name
$ lsblk
# let the name be "sda"

# for now file system is not important; will be formatted with mke2fs
# "mklabel gpt" results in corrupted partition; don't know why.
$ sudo parted /dev/sda
(parted) mklabel msdos
(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]?
Start? 4MiB
End? -1
(parted) print
Model: General UDisk (scsi)
Disk /dev/sda: 33.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 4194kB 33.6GB 33.5GB primary ext2 lba

(parted) quit
Information: You may need to update /etc/fstab.

$ sudo mkfs.ext4 /dev/sda1
# "mkfs.ext4" can be replaced with "mke2fs -t ext4"


Return to 우드샵 or how to partition and format USB memory (or SD card) with ext4 on linux