The Computer Oracle

How crazy is "sudo qemu -hda /dev/sda"(mounting host's sda as client's hda)?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Flying Over Ancient Lands

--

Chapters
00:00 How Crazy Is &Quot;Sudo Qemu -Hda /Dev/Sda&Quot;(Mounting Host'S Sda As Client'S Hda)?
00:32 Accepted Answer Score 11
01:11 Answer 2 Score 5
01:23 Thank you

--

Full question
https://superuser.com/questions/269277/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #qemu

#avk47



ACCEPTED ANSWER

Score 11


I would say it is incredibly dangerous.

You are right in your supposition that it would likely damage your /dev/sda.

Two systems accessing the same block device, each with their own cache and buffers, will definitely mean that each has a different idea of what is actually on the filesystem - changes made by one operating system will not be propagated properly to the other and you will start getting files overwriting each other.

All in all a horrible mess.

Now, if you had 2 operating systems installed on 2 different partitions (dual booting) you could use qemu to boot one of them inside the other, but you must never ever ever boot the same OS twice (unless it's a read-only OS like a live CD image for instance)




ANSWER 2

Score 5


You can safely run this command by using the -snapshot switch.

qemu usage:
-snapshot write to temporary files instead of disk image files