Sample Header Ad - 728x90

How can I format a partition in a mapper device?

4 votes
2 answers
491 views
I created a mapper device with dmsetup and created a partition table with parted:
$ fdisk -l /dev/mapper/vdisk
Disk /dev/mapper/vdisk: 511.57 GiB, 549295737344 bytes, 1072843237 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: gpt
Disk identifier: OMITTED

Device                       Start        End    Sectors   Size Type
/dev/mapper/vdisk-part1   2048     204799     202752    99M EFI System
/dev/mapper/vdisk-part2 204800 1072841188 1072636389 511.5G Microsoft basic data
Now how do I manipulate the partitions, say format the first partition to FAT? /dev/mapper/vdisk-part1 or /dev/mapper/vdisk1 don't seem to exist. PS: I do remember /dev/mapper/vdisk1 or something similar appeared after creating the partition table with parted, but disappeared after a reboot.
Asked by chienyan (43 rep)
Sep 11, 2024, 10:58 AM
Last activity: Sep 11, 2024, 11:30 AM