Skip to content

Copying files into images? #295

Answered by dranch
jbehrends asked this question in Q&A
Sep 7, 2023 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

I have a script that will do this mounting for simplistic use cases

http://www.trinityos.com/HAM/CentosDigitalModes/RPi/usr/local/sbin/mount-disk-image.sh

#!/bin/bash

11/18/22 - dranch mounting szbox disk image

If this doesn't work, run fdisk filename to see if an offset is required

fdisk -l file-image

Look at the START column and if it does NOT start at zero, record this number

Take that number and multiply by the sector size (say 512)

mount -o offset= nps-2010-emails.dd /media/manu/

#Optional Offset size - this is assuming 512 byte sectors
OFFSET=$((264*512))

if [ -z $1 ]; then
echo -e "\nDisk image not provided. Aborting\n"
exit 1
fi

if [ $UID -ne 0 ]; then
echo -e "\nYou must be root…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@jbehrends
Comment options

Comment options

You must be logged in to vote
3 replies
@jbehrends
Comment options

@aperezbios
Comment options

@jbehrends
Comment options

Answer selected by aperezbios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants