Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mountpi

Automated way to mount/umount a raspberry pi image under linux.

mountpi.sh usage

Installation

Simply copy the repository to your computer and make the script executable

git clone https://github.com/novamostra/mountpi
sudo chmod +x mountpi/mountpi.sh

v0.2 Changelog

  • Added - List image partitions usign the list flag (-l)
  • Added - Mount the boot partition using the boot flag (-b)
  • Added - Mount any ext4 partition by specifying it's index (-p)
  • Added - Mount all image's partitions using all flag (-a)
  • Added - More information during script execution using verbose flag (-v)
  • Fixed - Unmounting no longer requires the image name, only the mount directory.
  • Fixed - Flags and parameters handling optimization

Usage Instructions

  1. Clone the Git Repository
git clone https://github.com/novamostra/mountpi
  1. Add Execution Permission
sudo chmod +x mountpi/mountpi.sh

Functionality

  • List image partitions:
sudo ./mountpi -i path/to/raspberry.img -l
  • Mount all the partitions of an image to a specified directory:
sudo ./mountpi -i path/to/raspberry.img -m path/to/mnt/directory -a

This command will create in path/to/mnt/directory one subdirectory for each partition. For the boot partition the subdirectory will be named partition_boot while for each ext4 partition an partition_[parition_index] subdirectory will be created.

  • To unmount all partitions run:
sudo ./mountpi -u -m path/to/mnt/directory

This will unmount all the partitions and remove the directories.

  • Mount only the boot partition:
sudo ./mountpi -i path/to/raspberry.img -m path/to/mnt/directory -b
  • Mount a specific ext4 partition:
sudo ./mountpi -i path/to/raspberry.img -m path/to/mnt/directory -p 2

This will mount the second ext4 partition of the image. If -p parameter is omitted then it defaults to 1, so the first ext4 partition will be mounted.

Read more

Read more about how it works at novamostra.com and here about v0.2

Contributions

Special thanks to @pevsonic and RobertLauferElektrobit for their valuable contributions to the code.

About

Automated way to mount a raspberry pi image to linux

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages