AlexSSD7 / linsk

📂 Access Linux-native file systems (including LVM and LUKS) on Windows and macOS with help of a lightweight Alpine Linux VM. x86/ARM supported.
GNU General Public License v3.0
289 stars 12 forks source link

Permission Denied when attempting to read /dev/disk5, which is a disk image #22

Open GuillaumeDIDIER opened 2 weeks ago

GuillaumeDIDIER commented 2 weeks ago

Link 0.2.2 arm64 binary release for Darwin.

/dev/disk5 is a read-only image, attached through hdiutils.

/dev/disk5 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        +42.9 GB    disk5
   1:                      Linux                         1.1 GB     disk5s1
   2:                  Linux_LVM                         41.9 GB    disk5s2
$ sudo linsk ls dev:/dev/disk5  
time=2024-10-12T11:15:35.563+02:00 level=WARN msg="Using raw block device passthrough. Please note that it's YOUR responsibility to ensure that no device is mounted in your OS and the VM at the same time. Otherwise, you run serious risks. No further warnings will be issued." caller=vm
time=2024-10-12T11:15:35.570+02:00 level=INFO msg="Booting the VM" caller=vm
time=2024-10-12T11:15:35.620+02:00 level=WARN msg="Canceling the VM context" caller=vm
time=2024-10-12T11:15:35.620+02:00 level=ERROR msg="Failed to start the VM" error="cancel on exit: interrupt cmd: no such process (qemu stderr log: 'qemu-system-aarch64: -device driver=virtio-blk-pci,drive=drive1728724535569297000,logical_block_size=512,physical_block_size=512: Could not open '/dev/disk5': Permission denied')"

Is there any way to debug this ?

Bonus, would there be a way to just use a file from the file system instead of a device (pretty sure qemu would be quite capable of digesting all sorts of disk images)

GuillaumeDIDIER commented 2 weeks ago

In other news, it worked great to read my Asahi Linux disk, sudo linsk run dev:/dev/disk0sX vdb

Do you want me to make a PR to hint that you can pass a partition instead of a full disk (because disk0 has some partitions mounted on my host obviously) ?

AlexSSD7 commented 4 days ago

Hi @GuillaumeDIDIER. Glad you were able to sort that out, and apologies for my delayed response. PRs are always welcome.

GuillaumeDIDIER commented 4 days ago

I haven’t sorted out my original issue (wanted to mount the disks of some old virtual machines).

I’ll make a PR with the other thing I found though !