Skip to content

Instantly share code, notes, and snippets.

@doevelopper
Created September 7, 2017 22:41
Show Gist options
  • Save doevelopper/7b94c481d2075d5d8e31a5173666c651 to your computer and use it in GitHub Desktop.
Save doevelopper/7b94c481d2075d5d8e31a5173666c651 to your computer and use it in GitHub Desktop.
mount raspian for local dev intead of rsyn rpi
> fdisk -l raspbian.img
Disk raspbian.img: 1,7 GiB, 1854418944 bytes, 3621912 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: dos
Disk identifier: 0xee397c53
....
Device Boot Start End Sectors Size Id Type
raspbian.img1 8192 93813 85622 41,8M c W95 FAT32 (LBA)
raspbian.img2 94208 3621911 3527704 1,7G 83 Linux
Sector size: 512
start block: img1: 8192 and img2: 122880
mkdir -p /home/${USER}/dev/rootFS
mkdir -p /home/${USER}/dev/boot
mount raspbian.img -o loop,offset=$(( 512 * 8192)) /home/${USER}/dev/boot
mount raspbian.img -o loop,offset=$(( 512 * 94208)) /home/${USER}/dev/rootFS
sudo mount -v -o offset=$((512*94208)) -t ext4 raspbian.img /home/${USER}/dev/rootFS
comment in /home/${USER}/dev/rootFS/etc/fstab. qemu use /dev/sda not /dev/mmcblk0p* as sdcard
#/dev/mmcblk0p1 /boot vfat defaults 0 2
#/dev/mmcblk0p2 / ext4 errors=remount-ro,noatime,nodiratime,commit=120 0 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment