Public bug reported:

Steps to reproduce:
1. Install Ubuntu 16.04 LTS.
2. Try to install some distro (disk.iso) from ISO-file to USB-flash (/dev/sdc) 
with 
   sudo kvm -hda /dev/sdc -m 1024 -cdrom disk.iso -boot d
3. Get warning:

   WARNING: Image format was not specified for '/dev/sdc' 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.

4. After some time get file-system error on usb-flash drive (or GRUB
error, or drop to initramfs).

Expected results:
User is able to use simple QEMU-KVM command for installing distro to USB-flash 
(for example). 

Actual results:
Got file-system corruption on USB-flash.

Possible solution:
Pass format=raw to the kvm command (see this commit 
https://github.com/hartwork/grub2-theme-preview/commit/0cb285d98adeb644c50a915d6f350a56daa0cba2
 of grub2-theme-preview):
   kvm -drive file=/dev/sdc,format=raw -m 1024 -cdrom disk.iso -boot d

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: qemu-kvm 1:2.5+dfsg-5ubuntu10.10
ProcVersionSignature: Ubuntu 4.4.0-72.93-generic 4.4.49
Uname: Linux 4.4.0-72-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Apr 21 00:48:36 2017
InstallationDate: Installed on 2014-02-07 (1168 days ago)
InstallationMedia: Ubuntu 12.04.4 LTS "Precise Pangolin" - Release amd64 
(20140204)
KvmCmdLine:
 COMMAND         STAT  EUID  RUID   PID  PPID %CPU COMMAND
 kvm-irqfd-clean S<       0     0   349     2  0.0 [kvm-irqfd-clean]
 qemu-system-x86 Sl+   1000  1000  6635  6430 56.7 qemu-system-x86_64 
-enable-kvm -drive file=/home/nikolay/Temp/8G.raw,format=raw -m 1024 -cdrom 
ubuntu-1610-mini.iso -boot d
 kvm-pit/6635    S        0     0  6639     2  0.0 [kvm-pit/6635]
MachineType: ASUSTeK COMPUTER INC. UX32A
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-72-generic 
root=UUID=1e3c78e2-1a6e-4afe-8249-40fe7fa81a86 ro quiet splash vt.handoff=7
SourcePackage: qemu
UpgradeStatus: Upgraded to xenial on 2017-04-15 (4 days ago)
dmi.bios.date: 02/12/2014
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: UX32A.216
dmi.board.asset.tag: ATN12345678901234567
dmi.board.name: UX32A
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: 1.0
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK COMPUTER INC.
dmi.chassis.version: 1.0
dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvrUX32A.216:bd02/12/2014:svnASUSTeKCOMPUTERINC.:pnUX32A:pvr1.0:rvnASUSTeKCOMPUTERINC.:rnUX32A:rvr1.0:cvnASUSTeKCOMPUTERINC.:ct10:cvr1.0:
dmi.product.name: UX32A
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK COMPUTER INC.

** Affects: qemu (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1685031

Title:
  qemu-kvm corrupts filesystems on usb-flash drive if raw format is not
  specified

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1685031/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to