View previous topic :: View next topic |
Author |
Message |
holyspirit82 n00b
Joined: 12 Apr 2021 Posts: 20
|
Posted: Mon Jan 03, 2022 11:38 pm Post subject: mounting a file as a filesystem |
|
|
I have a file under /run/Jesus/Jesus and im trying to mount it to /run/Jesus directory as ext3
im doing
Code: |
mount -t ext3 -o loop /run/Jesus/Jesus /run/Jesus
|
but i get this error
Code: |
mount: /run/Jesus: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
|
ive installed cifs-utils and lsmod | grep loop shows that loop is there can anyone help |
|
Back to top |
|
|
transpetaflops Apprentice
Joined: 16 May 2005 Posts: 159
|
Posted: Tue Jan 04, 2022 12:02 am Post subject: |
|
|
Before addressing the actual error, I'd like to draw your attention to a couple of other potential problems:
Your file is stored in the /run filesystem which is normally a tmpfs filesystem, i.e. a RAM-disk. That file will not survive a power cycle and it will allocate your RAM. I suggest you move it to your SDD/HDD.
Also, you're trying to mount the file in the folder containing the said file. You will probably, at some point, get an error message from mount telling you that the mount point isn't empty. I suggest you create a folder called /mnt/Jesus and keep it empty for this purpose.
Now to your actual error. You haven't shared any details of the contents of this file but I assume it's a complete disk image rather than an image of a single partition? You have to perform some additional commands to make it work.
1) Read the partition table from the image with "fdisk -l /run/Jesus/Jesus"
2) Identify the partition containing the filesystem you want to mount and make note of the start sector
3) Mount that partition with "mount -o loop,offset=$((nnn * 512)) /run/Jesus/Jesus /mnt/Jesus". Replace nnn with the start sector from step 2. The "512" is the sector size and should match the output from fdisk in step 1. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Tue Jan 04, 2022 2:17 am Post subject: |
|
|
transpetaflops wrote: | Also, you're trying to mount the file in the folder containing the said file. You will probably, at some point, get an error message from mount telling you that the mount point isn't empty. | mount will allow mounting over a non-empty directory. This is not an error at the kernel level, though it can confuse users. transpetaflops wrote: | 3) Mount that partition with "mount -o loop,offset=$((nnn * 512)) /run/Jesus/Jesus /mnt/Jesus". Replace nnn with the start sector from step 2. The "512" is the sector size and should match the output from fdisk in step 1. | Wouldn't it be easier to use losetup with --partscan to make the kernel handle partition management, then use mount on the resulting loop block device? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|