Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GuillaumeDIDIER opened this issue Oct 12, 2024 · 4 comments

Comments

@GuillaumeDIDIER
Copy link

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
Copy link
Author

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
Copy link
Owner

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

@GuillaumeDIDIER
Copy link
Author

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 !

@ty802
Copy link

ty802 commented Nov 7, 2024

I don't think this is an issue
As far as i know if you want to pass the entire disk and have sip enable you need to use /dev/rdisk# (some part of macos takes exclusive control over all the /dev/disk# devices)
I assume this is done to prevent writing to parts of the drive that make up the system volume while the system is running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants