LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

kpartx

creates device mapper entries for the partitions within a disk image or block

TLDR

Add partition mappings and print them
$ kpartx -av [whole_disk.img]
copy
Delete partition mappings
$ kpartx -d [whole_disk.img]
copy
List partition mappings
$ kpartx -l [whole_disk.img]
copy

SYNOPSIS

kpartx [options] device

DESCRIPTION

kpartx creates device mapper entries for the partitions within a disk image or block device. This allows individual partitions to be accessed as separate block devices, enabling mounting and manipulation.When adding mappings, kpartx creates entries like /dev/mapper/loop0p1, /dev/mapper/loop0p2, etc., corresponding to each partition found in the image.

PARAMETERS

-a

Add partition mappings
-d
Delete partition mappings
-l
List partition mappings without adding them
-v
Verbose output
-s
Sync mode (wait for udev to update)
-f
Force creation of mappings

INSTALL

sudo apt install kpartx
copy
sudo dnf install kpartx
copy
sudo apk add kpartx
copy
sudo zypper install kpartx
copy

CAVEATS

Requires root privileges. Device mapper and loop device support must be enabled in the kernel. Mappings should be removed before detaching loop devices.

HISTORY

kpartx is part of the multipath-tools package. It was developed to simplify working with partitioned disk images, particularly useful for virtual machine images and system administration tasks.

SEE ALSO

losetup(8), dmsetup(8), mount(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid