Skip to content

Instantly share code, notes, and snippets.

@drinkcat
Created October 7, 2014 20:25
Show Gist options
  • Save drinkcat/8209d412a25a1a0f79f6 to your computer and use it in GitHub Desktop.
Save drinkcat/8209d412a25a1a0f79f6 to your computer and use it in GitHub Desktop.
Mount ext4 loop/dm device on FAT32
#!/bin/sh
set -e -x
losetup /dev/loop10 ext4.bin_01
losetup /dev/loop11 ext4.bin_02
size1=$(blockdev --getsz /dev/loop10)
size2=$(blockdev --getsz /dev/loop11)
dmsetup create crouton << EOF
0 $size1 linear /dev/loop10 0
$size1 $size2 linear /dev/loop11 0
EOF
mount -o noatime /dev/disk/by-id/dm-name-crouton ext4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment