qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] format=raw,readonly errors


From: John Snow
Subject: Re: [Qemu-devel] format=raw,readonly errors
Date: Mon, 8 May 2017 11:32:12 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0


On 05/08/2017 10:15 AM, Carl Karsten wrote:
> On Mon, May 8, 2017 at 3:51 AM, Markus Armbruster <address@hidden> wrote:
> 
>> Carl Karsten <address@hidden> writes:
>>
>>> address@hidden:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
>>> file=disk.cow -drive file=boot.img
>>> WARNING: Image format was not specified for 'boot.img' and probing
>> guessed
>>> raw.
>>>          Automatically detecting the format is dangerous for raw images,
>>> write operations on block 0 will be restricted.
>>>          Specify the 'raw' format explicitly to remove the restrictions.
>>>
>>> This is OK, as I don't want anything writing to that thing anyway.  So to
>>> get rid of the waring:
>>>
>>> address@hidden:~/temp$ qemu-system-x86_64 -drive
>>> file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a
>> read-only
>>> drive
>>> qemu-system-x86_64: Initialization of device ide-hd failed: Device
>>> initialization failed.
>>
>> -drive without if=... creates an IDE disk[*].  IDE disks can't do
>> read-only.  Have you tried omitting ",readonly"?
>>
> 
> 
> omitting works, but my goal was for the drive to be read only.
> 
> 

I don't think there's a way to make physical IDE drives "read only." I
don't think there's any jumper settings or any of the like which can
accomplish this.

Unlike floppy disks (which you could notch the corner of) or SD cards
(which have the write lock), I don't think ATA disks have a method for
being "read only," so this isn't a feature QEMU can support.

What you CAN do, however, is to use -snapshot or otherwise use something
like a qcow2 overlay to trap all writes to a temporary file that you can
discard at a later point in time, effectively keeping your original
image "read only."

I believe that SCSI disks support a read-only mode, though.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]