-
Notifications
You must be signed in to change notification settings - Fork 200
Development ~ Mounting images
Inside the .img file there are usually two partitions: /boot partition and the main partition holding operating system , home directory etc. The first one /boot is possible to mount using different tools in Windows and get to the files. But the second partition will be much more difficult to mount on Windows as it a type of a Linux partition. Therefore in this guide we will show to do it on a Linux box. I did this on CentOS but it can be done on any other.
Get .img file into your linux box. Run this to examine it's contents
# kpartx -l FILE.img
Output will be something like this
loop3p1 : 0 65536 /dev/loop1 8192 loop3p2 : 0 8388608 /dev/loop2 81920
This shows two partitions without creating any loop devices. Now create two loop devices.
# kpartx -a FILE.img`
They will end up as /dev/mapper/loop0p1 and /dev/mapper/loop0p2.
The final step is to mount them. Create mount dirs before mounting.
# mkdir /mnt2/loop1 /mnt2/loop2
# mount -o loop /dev/mapper/loop0p1 /mnt2/loop1/
# mount -o loop /dev/mapper/loop0p2 /mnt2/loop2/
Done. You partitions are now accessible under /mnt2/loop1 and /mnt2/loop2
Copy or edit files as needed. You can now unmount the partitions
# umount /mnt2/loop1
# umount /mnt2/loop2
You should now be able to write .img to SDcard and boot into it.
# sudo dd if=/dev/"your SDcard" of=FILE.img
You can find the name of "your SDcard" with :
# lsblk
don't use sda, it's your main harddisk and it would be totally erased !! "your SDcard" should named sdb or sdc or mmcblk0. Try the lsblk command with and without our SDcard to identify its label.
General
Hardware Setup
- Proper Wiring
- Power Supply (BECs)
- Supported Pi models
- Supported Cameras
- Supported WiFi Adapters
- Supported Displays
- Antennas
- DIY builds
Software Setup
- Basic configuration options
- Advanced Options
RC Control
- General
- RC with Ardupilot (MAVlink)
- RC with iNav
- DIY builds
Ground Stations
- Mission Planner (Windows)
- QGroundControl (Windows / Linux / Mac / Android /iOS)
- APM Planner (Windows / Mac / Linux)
- Tower (Android)
- FPV_VR (Android)
- GStreamer (Windows / Mac / Linux)
- Fishing FanCam (iOS)
Expert Settings
- OSD MAVLink message types
- Transmit power settings
- SSH shell
- Raspivid camera settings
- Optimizing-Power-Consumption
Extensions / AddOns
- HDMI-in cards
- WebCams
- Video Switcher
- Thermal (FLIR, Seek)
- 360° cameras
Community-HUB
Developer's Corner
- Room for Improvement
- Mounting Images
- Reducing Images size
- WinSCP (copying files)