You are not logged in.

#1 2017-10-28 13:05:37

Jmillwood
Member
Registered: 2016-09-19
Posts: 10

Permissions Mounting Raspberry Pi Image

I have read a few other posts about mounting an image so that I can edit the files in it and I have been trying to mount it as root as a loop back device and I calculated the offset. But I keep getting permission errors.

I check the offset and unit information of the image with:

fdisk -l emlid-raspbian-20170323-jessie.img
Disk emlid-raspbian-20170323-jessie.img: 2.8 GiB, 2944401408 bytes, 5750784 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: 0x0bb3234b

Device                              Boot  Start     End Sectors  Size Id Type
emlid-raspbian-20170323-jessie.img1        8192  149503  141312   69M  c W95 FAT32 (LBA)
emlid-raspbian-20170323-jessie.img2      149504 5750783 5601280  2.7G 83 Linux

I calculate the offset as 512*149504=76546048

I then log in as root with "su -"
I make a directory as root

mkdir /mnt/emlid

and then try to mount it there

# mount -v -o loop,offset=76546048 emlid-raspbian-20170323-jessie.img /mnt/emlid/
mount: /mnt/emlid/: mount failed: Operation not permitted.

I tried with the "-t ext4" argument as well, but got the same outcome.
I haven't done anything to my "fstab" file and it looks like the root line is

/dev/sda1           	/         	ext4      	rw,relatime,data=ordered	0 1

If anyone has any suggestions, it'd be appreciated. All of the posts I've seen doing this don't mention any permission things except the need to be root, which  I am.

Last edited by Jmillwood (2017-10-28 13:20:05)

Offline

#2 2017-10-28 13:13:47

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Permissions Mounting Raspberry Pi Image

Your code tags don't work. Use [ code] [ /code ] (without the spaces).

Offline

#3 2017-10-28 13:21:01

Jmillwood
Member
Registered: 2016-09-19
Posts: 10

Re: Permissions Mounting Raspberry Pi Image

Yep thanks, just saw that on the bbcode site. I was looking at the syntax on FluxBB

Offline

Board footer

Powered by FluxBB