Ubuntu - mount image file with r/w permissionExt3 drive will not mount after power failure; how to recover...
Count repetitions of an array
Website seeing my Facebook data?
Describe a span of time of 1 or 2 years, without being too literal
How to politely refuse in-office gym instructor for steroids and protein
Should I cite R or RStudio?
What is the difference between "...", '...', $'...', and $"..." quotes?
Why did Luke use his left hand to shoot?
When obtaining gender reassignment/plastic surgery overseas, is an emergency travel document required to return home?
Is there a way to store 9th-level spells in a Glyph of Warding or similar method?
Do authors have to be politically correct in article-writing?
The No-Straight Maze
I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."
Why didn't the 2019 Oscars have a host?
Is a creature that sees a Medusa's eyes automatically subjected to a saving throw?
Why is the "Domain users" group missing from this Powershell AD Query?
Cat is tipping over bed-side lamps during the night
Equivalent of "illegal" for violating civil law
Calculate of total length of edges in Voronoi diagram
What is the industry term for house wiring diagrams?
Why does 0.-5 evaluate to -5?
Possible issue with my W4 and tax return
Will rerolling initiative each round stop meta-gaming about initiative?
Can we "borrow" our answers to populate our own websites?
Is there a way to not have to poll the UART of an AVR?
Ubuntu - mount image file with r/w permission
Ext3 drive will not mount after power failure; how to recover files?mounting minix filesystem on ubuntuUbuntu 6.06: Mounting /root/sda1 /root failed: No such devicehard drive broken?Recovering DATA from HDD pulled from failed NASRestore access to Linux partition after wiping Windows partition through Windows installerUnrecognized mount option “fmask=0111” or missing valuelinux refused to mount a valid partitionI connected my usb hdd driver. CentOS7 don't mount itRecover Data from ext4 Volume (Structure Needs Cleaning, etc.)
Host: Ubuntu 15.04
With Disk Image Mounter
, I can mount the test.img and three directories popped up.
- system-a
- system-b
- writable
As I've searched around, I can not edit the directories since those are read-only.
The possible solution I found so far is to copy these directories to another new place and generate a new image file.
However, since the image file contains these three directories, how can I do it?
=============post update=============
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
=====================================
Device Start End Sectors Size Type
test_custom2.img1 8192 16383 8192 4M BIOS boot
test_custom2.img2 16384 147455 131072 64M EFI System
test_custom2.img3 147456 2244607 2097152 1G Linux filesystem
test_custom2.img4 2244608 4341759 2097152 1G Linux filesystem
test_custom2.img5 4341760 7614463 3272704 1.6G Linux filesystem
linux ubuntu
migrated from stackoverflow.com Dec 28 '15 at 17:06
This question came from our site for professional and enthusiast programmers.
add a comment |
Host: Ubuntu 15.04
With Disk Image Mounter
, I can mount the test.img and three directories popped up.
- system-a
- system-b
- writable
As I've searched around, I can not edit the directories since those are read-only.
The possible solution I found so far is to copy these directories to another new place and generate a new image file.
However, since the image file contains these three directories, how can I do it?
=============post update=============
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
=====================================
Device Start End Sectors Size Type
test_custom2.img1 8192 16383 8192 4M BIOS boot
test_custom2.img2 16384 147455 131072 64M EFI System
test_custom2.img3 147456 2244607 2097152 1G Linux filesystem
test_custom2.img4 2244608 4341759 2097152 1G Linux filesystem
test_custom2.img5 4341760 7614463 3272704 1.6G Linux filesystem
linux ubuntu
migrated from stackoverflow.com Dec 28 '15 at 17:06
This question came from our site for professional and enthusiast programmers.
What type of filesystem does the image hold?
– andreas-hofmann
Dec 28 '15 at 9:16
@andreas-hofmann ext4
– Sam
Dec 28 '15 at 9:37
Are there any partitions in the image? What does the output offdisk -l image.img
say?
– andreas-hofmann
Dec 28 '15 at 10:16
@andreas-hofmann post updated.
– Sam
Dec 28 '15 at 10:18
add a comment |
Host: Ubuntu 15.04
With Disk Image Mounter
, I can mount the test.img and three directories popped up.
- system-a
- system-b
- writable
As I've searched around, I can not edit the directories since those are read-only.
The possible solution I found so far is to copy these directories to another new place and generate a new image file.
However, since the image file contains these three directories, how can I do it?
=============post update=============
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
=====================================
Device Start End Sectors Size Type
test_custom2.img1 8192 16383 8192 4M BIOS boot
test_custom2.img2 16384 147455 131072 64M EFI System
test_custom2.img3 147456 2244607 2097152 1G Linux filesystem
test_custom2.img4 2244608 4341759 2097152 1G Linux filesystem
test_custom2.img5 4341760 7614463 3272704 1.6G Linux filesystem
linux ubuntu
Host: Ubuntu 15.04
With Disk Image Mounter
, I can mount the test.img and three directories popped up.
- system-a
- system-b
- writable
As I've searched around, I can not edit the directories since those are read-only.
The possible solution I found so far is to copy these directories to another new place and generate a new image file.
However, since the image file contains these three directories, how can I do it?
=============post update=============
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
=====================================
Device Start End Sectors Size Type
test_custom2.img1 8192 16383 8192 4M BIOS boot
test_custom2.img2 16384 147455 131072 64M EFI System
test_custom2.img3 147456 2244607 2097152 1G Linux filesystem
test_custom2.img4 2244608 4341759 2097152 1G Linux filesystem
test_custom2.img5 4341760 7614463 3272704 1.6G Linux filesystem
linux ubuntu
linux ubuntu
edited Jan 11 '16 at 14:47
Chenmunka
2,79481931
2,79481931
asked Dec 28 '15 at 7:54
SamSam
12116
12116
migrated from stackoverflow.com Dec 28 '15 at 17:06
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Dec 28 '15 at 17:06
This question came from our site for professional and enthusiast programmers.
What type of filesystem does the image hold?
– andreas-hofmann
Dec 28 '15 at 9:16
@andreas-hofmann ext4
– Sam
Dec 28 '15 at 9:37
Are there any partitions in the image? What does the output offdisk -l image.img
say?
– andreas-hofmann
Dec 28 '15 at 10:16
@andreas-hofmann post updated.
– Sam
Dec 28 '15 at 10:18
add a comment |
What type of filesystem does the image hold?
– andreas-hofmann
Dec 28 '15 at 9:16
@andreas-hofmann ext4
– Sam
Dec 28 '15 at 9:37
Are there any partitions in the image? What does the output offdisk -l image.img
say?
– andreas-hofmann
Dec 28 '15 at 10:16
@andreas-hofmann post updated.
– Sam
Dec 28 '15 at 10:18
What type of filesystem does the image hold?
– andreas-hofmann
Dec 28 '15 at 9:16
What type of filesystem does the image hold?
– andreas-hofmann
Dec 28 '15 at 9:16
@andreas-hofmann ext4
– Sam
Dec 28 '15 at 9:37
@andreas-hofmann ext4
– Sam
Dec 28 '15 at 9:37
Are there any partitions in the image? What does the output of
fdisk -l image.img
say?– andreas-hofmann
Dec 28 '15 at 10:16
Are there any partitions in the image? What does the output of
fdisk -l image.img
say?– andreas-hofmann
Dec 28 '15 at 10:16
@andreas-hofmann post updated.
– Sam
Dec 28 '15 at 10:18
@andreas-hofmann post updated.
– Sam
Dec 28 '15 at 10:18
add a comment |
3 Answers
3
active
oldest
votes
The problem is that there are multiple partitions in your image. A plain old mount looks for filesystem information at offset 0, which in your case apparently points to some bios boot information, but not to the desired ext4 fs. You should succeed by creating the loopback-device with an offset to the desired partition.
This link may help you out.
add a comment |
You need to make sure that your current user directory has read and write access to your operation
sudo mkdir -p /tmp/test && sudo mount -o loop,rw,sync image.img /tmp/test
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
add a comment |
Here's the full process, based on the answer here:
Your .img file is not an image of a partition, but of a whole disk. That means it starts with a bootloader and a partition table. You have to detect the offset of the partition and mount it specifically. So you have to do math, but it's easy. Here's the process:
fdisk -l raspberry_pi.img
Which gives the output below. Note the sector size in bytes (512 in this case) and the Start sector of the partition (94208 for the Linux partition in this case).
Disk raspberry_pi.img: 7.3 GiB, 7826571264 bytes, 15286272 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: 0xbeb1a7ff
Device Boot Start End Sectors Size Id Type
raspberry_pi.img1 8192 93813 85622 41.8M c W95 FAT32 (LBA)
raspberry_pi.img2 94208 15069183 14974976 7.1G 83 Linux
Now, manually multiply the start sector * sector size to get the offset bytes that the mount
command needs. In this case, 94208 * 512 = 48234496
sudo mkdir /media/sdcard
sudo mount -o loop,rw,sync,offset=48234496 printer_v5.img /media/sdcard
Now, the image's Linux partition is mounted at /media/sdcard and the root user can edit its files.
Finally, when you're finished:
sudo umount /media/sdcard
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1018877%2fubuntu-mount-image-file-with-r-w-permission%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem is that there are multiple partitions in your image. A plain old mount looks for filesystem information at offset 0, which in your case apparently points to some bios boot information, but not to the desired ext4 fs. You should succeed by creating the loopback-device with an offset to the desired partition.
This link may help you out.
add a comment |
The problem is that there are multiple partitions in your image. A plain old mount looks for filesystem information at offset 0, which in your case apparently points to some bios boot information, but not to the desired ext4 fs. You should succeed by creating the loopback-device with an offset to the desired partition.
This link may help you out.
add a comment |
The problem is that there are multiple partitions in your image. A plain old mount looks for filesystem information at offset 0, which in your case apparently points to some bios boot information, but not to the desired ext4 fs. You should succeed by creating the loopback-device with an offset to the desired partition.
This link may help you out.
The problem is that there are multiple partitions in your image. A plain old mount looks for filesystem information at offset 0, which in your case apparently points to some bios boot information, but not to the desired ext4 fs. You should succeed by creating the loopback-device with an offset to the desired partition.
This link may help you out.
answered Dec 28 '15 at 10:23
andreas-hofmannandreas-hofmann
1263
1263
add a comment |
add a comment |
You need to make sure that your current user directory has read and write access to your operation
sudo mkdir -p /tmp/test && sudo mount -o loop,rw,sync image.img /tmp/test
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
add a comment |
You need to make sure that your current user directory has read and write access to your operation
sudo mkdir -p /tmp/test && sudo mount -o loop,rw,sync image.img /tmp/test
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
add a comment |
You need to make sure that your current user directory has read and write access to your operation
sudo mkdir -p /tmp/test && sudo mount -o loop,rw,sync image.img /tmp/test
You need to make sure that your current user directory has read and write access to your operation
sudo mkdir -p /tmp/test && sudo mount -o loop,rw,sync image.img /tmp/test
edited Sep 30 '18 at 20:37
evandrix
10914
10914
answered Dec 28 '15 at 8:10
Job.F
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
add a comment |
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
thanks, but I got the error by typing your command
– Sam
Dec 28 '15 at 8:19
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
I've updated the post, please let me know if you have any further idea.
– Sam
Dec 28 '15 at 9:01
add a comment |
Here's the full process, based on the answer here:
Your .img file is not an image of a partition, but of a whole disk. That means it starts with a bootloader and a partition table. You have to detect the offset of the partition and mount it specifically. So you have to do math, but it's easy. Here's the process:
fdisk -l raspberry_pi.img
Which gives the output below. Note the sector size in bytes (512 in this case) and the Start sector of the partition (94208 for the Linux partition in this case).
Disk raspberry_pi.img: 7.3 GiB, 7826571264 bytes, 15286272 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: 0xbeb1a7ff
Device Boot Start End Sectors Size Id Type
raspberry_pi.img1 8192 93813 85622 41.8M c W95 FAT32 (LBA)
raspberry_pi.img2 94208 15069183 14974976 7.1G 83 Linux
Now, manually multiply the start sector * sector size to get the offset bytes that the mount
command needs. In this case, 94208 * 512 = 48234496
sudo mkdir /media/sdcard
sudo mount -o loop,rw,sync,offset=48234496 printer_v5.img /media/sdcard
Now, the image's Linux partition is mounted at /media/sdcard and the root user can edit its files.
Finally, when you're finished:
sudo umount /media/sdcard
New contributor
add a comment |
Here's the full process, based on the answer here:
Your .img file is not an image of a partition, but of a whole disk. That means it starts with a bootloader and a partition table. You have to detect the offset of the partition and mount it specifically. So you have to do math, but it's easy. Here's the process:
fdisk -l raspberry_pi.img
Which gives the output below. Note the sector size in bytes (512 in this case) and the Start sector of the partition (94208 for the Linux partition in this case).
Disk raspberry_pi.img: 7.3 GiB, 7826571264 bytes, 15286272 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: 0xbeb1a7ff
Device Boot Start End Sectors Size Id Type
raspberry_pi.img1 8192 93813 85622 41.8M c W95 FAT32 (LBA)
raspberry_pi.img2 94208 15069183 14974976 7.1G 83 Linux
Now, manually multiply the start sector * sector size to get the offset bytes that the mount
command needs. In this case, 94208 * 512 = 48234496
sudo mkdir /media/sdcard
sudo mount -o loop,rw,sync,offset=48234496 printer_v5.img /media/sdcard
Now, the image's Linux partition is mounted at /media/sdcard and the root user can edit its files.
Finally, when you're finished:
sudo umount /media/sdcard
New contributor
add a comment |
Here's the full process, based on the answer here:
Your .img file is not an image of a partition, but of a whole disk. That means it starts with a bootloader and a partition table. You have to detect the offset of the partition and mount it specifically. So you have to do math, but it's easy. Here's the process:
fdisk -l raspberry_pi.img
Which gives the output below. Note the sector size in bytes (512 in this case) and the Start sector of the partition (94208 for the Linux partition in this case).
Disk raspberry_pi.img: 7.3 GiB, 7826571264 bytes, 15286272 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: 0xbeb1a7ff
Device Boot Start End Sectors Size Id Type
raspberry_pi.img1 8192 93813 85622 41.8M c W95 FAT32 (LBA)
raspberry_pi.img2 94208 15069183 14974976 7.1G 83 Linux
Now, manually multiply the start sector * sector size to get the offset bytes that the mount
command needs. In this case, 94208 * 512 = 48234496
sudo mkdir /media/sdcard
sudo mount -o loop,rw,sync,offset=48234496 printer_v5.img /media/sdcard
Now, the image's Linux partition is mounted at /media/sdcard and the root user can edit its files.
Finally, when you're finished:
sudo umount /media/sdcard
New contributor
Here's the full process, based on the answer here:
Your .img file is not an image of a partition, but of a whole disk. That means it starts with a bootloader and a partition table. You have to detect the offset of the partition and mount it specifically. So you have to do math, but it's easy. Here's the process:
fdisk -l raspberry_pi.img
Which gives the output below. Note the sector size in bytes (512 in this case) and the Start sector of the partition (94208 for the Linux partition in this case).
Disk raspberry_pi.img: 7.3 GiB, 7826571264 bytes, 15286272 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: 0xbeb1a7ff
Device Boot Start End Sectors Size Id Type
raspberry_pi.img1 8192 93813 85622 41.8M c W95 FAT32 (LBA)
raspberry_pi.img2 94208 15069183 14974976 7.1G 83 Linux
Now, manually multiply the start sector * sector size to get the offset bytes that the mount
command needs. In this case, 94208 * 512 = 48234496
sudo mkdir /media/sdcard
sudo mount -o loop,rw,sync,offset=48234496 printer_v5.img /media/sdcard
Now, the image's Linux partition is mounted at /media/sdcard and the root user can edit its files.
Finally, when you're finished:
sudo umount /media/sdcard
New contributor
edited 6 hours ago
New contributor
answered 6 hours ago
LukeLuke
1013
1013
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1018877%2fubuntu-mount-image-file-with-r-w-permission%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What type of filesystem does the image hold?
– andreas-hofmann
Dec 28 '15 at 9:16
@andreas-hofmann ext4
– Sam
Dec 28 '15 at 9:37
Are there any partitions in the image? What does the output of
fdisk -l image.img
say?– andreas-hofmann
Dec 28 '15 at 10:16
@andreas-hofmann post updated.
– Sam
Dec 28 '15 at 10:18