You are not logged in.

#1 2023-04-23 17:06

bretsim
Member
Registered: 2021-11-21
Posts: 22

Any way to mount a .disk file from within q4os?

I've reinstalled q4os after previous catastrophic user error, but still have my backup root.disk from my previous install. Is there any way to mount it directly as another drive in the new install? I know I can open it in 7zip in Windows and presumably in Linux to get to the files, but opening it is a slow process each time given the size of the file.

I feel it must be possible for Q4os to treat a filesystem created by q4os as a filesystem directly?

Offline

#2 2023-04-23 17:12

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,501
Website

Re: Any way to mount a .disk file from within q4os?

Yes, it's possible to mount the root.disk from within Q4OS terminal:
$ mkdir -p /tmp/mntpoint/
$ sudo losetup --show -f -P /<path_to>/root.disk
$ sudo mount /dev/loopX /tmp/mntpoint/

don't forget to unmount prior poweroff:
$ sudo umount /tmp/mntpoint/
$ sudo losetup -d /dev/loopX

substitute "loopX" for a loop device number issued by the "losetup" command, for ex. "loop1".

Last edited by q4osteam (2023-04-24 11:03)

Offline

#3 2023-04-23 18:16

bretsim
Member
Registered: 2021-11-21
Posts: 22

Re: Any way to mount a .disk file from within q4os?

q4osteam wrote:

Yes, it should be possible to mount the root.disk from within Q4OS terminal:
$ mkdir -p /tmp/mntpoint/
$ sudo losetup --show -f -P root.disk
$ sudo mount /dev/loop0 /tmp/mntpoint/

don't forget to unmount prior poweroff:
$ sudo umount /tmp/mntpoint/
$ sudo losetup -d /dev/loop0


Thanks. I'll try that. When I tried to mount it using more general Linux commands, I kept getting told the disk file didn't exist so hopefully this will work better.

Is it possible to create shortcuts for those mount/ unmount commands? Or even better, get the OS to do it automatically on boot and end of session?

Offline

#4 2023-04-24 05:18

bretsim
Member
Registered: 2021-11-21
Posts: 22

Re: Any way to mount a .disk file from within q4os?

q4osteam wrote:

Yes, it should be possible to mount the root.disk from within Q4OS terminal:
$ mkdir -p /tmp/mntpoint/
$ sudo losetup --show -f -P root.disk
$ sudo mount /dev/loop0 /tmp/mntpoint/

don't forget to unmount prior poweroff:
$ sudo umount /tmp/mntpoint/
$ sudo losetup -d /dev/loop0


"Losetup: root.disk: failed to set up loop device: No such file or directory"

Essentially the same error as the other methods I tried. I also put the file path (/media/sda3/root.disk) into the command to see if that made a difference, but it didn't.

Any suggestions?

(Really frustratingly bad experience with Q4OS this time round... it keeps pretending that my wireless hotspot doesn't exist, which is a pretty basic functionality on which to fail!)

Last edited by bretsim (2023-04-24 05:23)

Offline

#5 2023-04-24 06:48

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,333

Re: Any way to mount a .disk file from within q4os?

bretsim wrote:

(Really frustratingly bad experience with Q4OS this time round... it keeps pretending that my wireless hotspot doesn't exist, which is a pretty basic functionality on which to fail!)

I can see this may be frustrating. I suggest you raise a new topic in the support section and provide full details of how your hotspot is set up. To me that's using a mobile phone for wifi, to you it could mean something different.
If you're dual booting it could be that Windows is doing something funny with loading firmware which strips up the linux drivers.
Please run 

inxi -SMCGx

in Konsole and include output in your new post.

Offline

#6 2023-04-24 07:48

bretsim
Member
Registered: 2021-11-21
Posts: 22

Re: Any way to mount a .disk file from within q4os?

bin wrote:
bretsim wrote:

(Really frustratingly bad experience with Q4OS this time round... it keeps pretending that my wireless hotspot doesn't exist, which is a pretty basic functionality on which to fail!)

I can see this may be frustrating. I suggest you raise a new topic in the support section and provide full details of how your hotspot is set up. To me that's using a mobile phone for wifi, to you it could mean something different.
If you're dual booting it could be that Windows is doing something funny with loading firmware which strips up the linux drivers.
Please run 

inxi -SMCGx

in Konsole and include output in your new post.

Thanks for taking the time to reply. I solved the WiFi issue by some combination of restarting the laptop and/or changing the SSID of the network.

The main issue of my post (mounting an old q4os .disk file from within q4os) remains unresolved, however.

Offline

#7 2023-04-24 11:01

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,501
Website

Re: Any way to mount a .disk file from within q4os?

bretsim wrote:

"Losetup: root.disk: failed to set up loop device: No such file or directory"

You only need to specify path to the loop file and correct loop device number, so we have updated post with the original instructions https://www.q4os.org/forum/viewtopic.ph … 542#p24542

Offline

#8 2023-04-24 15:01

bretsim
Member
Registered: 2021-11-21
Posts: 22

Re: Any way to mount a .disk file from within q4os?

q4osteam wrote:
bretsim wrote:

"Losetup: root.disk: failed to set up loop device: No such file or directory"

You only need to specify path to the loop file and correct loop device number, so we have updated post with the original instructions https://www.q4os.org/forum/viewtopic.ph … 542#p24542

Thanks! That seems to have done the trick.

Is there a way to do this automatically at every boot (and unmount at power down)

Offline

#9 2023-10-22 08:40

bretsim
Member
Registered: 2021-11-21
Posts: 22

Re: Any way to mount a .disk file from within q4os?

q4osteam wrote:

Yes, it's possible to mount the root.disk from within Q4OS terminal:
$ mkdir -p /tmp/mntpoint/
$ sudo losetup --show -f -P /<path_to>/root.disk
$ sudo mount /dev/loopX /tmp/mntpoint/

don't forget to unmount prior poweroff:
$ sudo umount /tmp/mntpoint/
$ sudo losetup -d /dev/loopX

substitute "loopX" for a loop device number issued by the "losetup" command, for ex. "loop1".

Coming back to this issue a few months on, and I would still love a way to automate this at startup if at all possible, rather than having to enter every command individually every time.

Is there a way? I guess it would also entail auto mounting the relevant partition too.

Offline

#10 2023-10-22 15:02

nightflier
Member
Registered: 2023-07-11
Posts: 23

Re: Any way to mount a .disk file from within q4os?

You could put those commands in a script and execute that. Since there are sudo commands it will be interactive, so full automation would involve messing with system files. Before going that far, experiment by creating a text file with the desired commands, then execute it with "sh textfile".

Offline

Board footer

Powered by FluxBB