qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: qemu disk on vfat


From: Michael McConnell
Subject: Re: [Qemu-devel] Re: qemu disk on vfat
Date: Mon, 8 May 2006 23:05:00 +0100 (BST)

On Tue, 9 May 2006, Yann Le Doaré wrote:

> You are right ! :
> 
> sh-2.05b# qemu-img create /mnt/partitions/windows0/qmeu-disk 4M
> Formating '/mnt/partitions/windows0/qmeu-disk', fmt=raw, size=4096 kB
> sh-2.05b# ls -al /mnt/partitions/windows0/qmeu-disk            
> -rwxr-xr-x    1 root     root            0 2006-05-09
> 23:37 /mnt/partitions/windows0/qmeu-disk
> sh-2.05b# qemu-img create /mnt/partitions/windows0/qmeu-disk 40M
> Formating '/mnt/partitions/windows0/qmeu-disk', fmt=raw, size=40960 kB
> sh-2.05b# ls -al /mnt/partitions/windows0/qmeu-disk             
> -rwxr-xr-x    1 root     root            0 2006-05-09
> 23:38 /mnt/partitions/windows0

IIRC creating a "raw" QEMU disc image makes use of sparse files, a concept 
not supported under FAT16/32.  A qcow disc image should work fine.  If you 
want to create a raw disc image on a FAT partition, use (from your example)
dd if=/dev/zero of=/mnt/partitions/windows0/qmeu-disk bs=1024 count=40960

It'll take a bit longer than qemu-img would but then it's having to write out 
every block in the disc image to the real disc.

Hope that helps.

> Le lundi 08 mai 2006 à 16:12 -0500, Anthony Liguori a écrit :
> > On Sun, 07 May 2006 08:13:01 +0000, Yann Le Doaré wrote:
> > 
> > > Hi,
> > > 
> > > It seems like qemu 0.8.0 does not accept image file from a vfat partition.
> > > Is it a bug ?
> > > 
> > > Greetings.
> > > 
> > > Yann Le Doaré.
> > > 
> > > 
> > > strace :
> > > 
> > > open("/mnt/partitions/windows0/qmeu-disk", O_RDONLY|O_LARGEFILE) = 7
> > > read(7, "", 1024)                       = 0 close(7)                      
> > >          = 0 open("/mnt/partitions/windows0/qmeu-disk",
> > > O_RDONLY|O_LARGEFILE) = 7 _llseek(7, 128, [128], SEEK_SET)        = 0
> > > read(7, "", 4)                          = 0 close(7)                      
> > >          = 0 write(2, "qemu: could not open hard disk i"..., 74qemu: could
> > > not open hard disk image '/mnt/partitions/windows0/qmeu-disk' ) = 74
> > > exit_group(1)                           = ?
> > 
> > It's pretty clear that what's happening is that qemu opening the file and
> > the filesystem is claiming it's an empty file.
> > 
> > So, I recommend you do the following:
> > 
> > First:
> > 
> > du -sh /mnt/partitions/windows0/qmeu-disk
> > ls -al /mnt/partitions/windows0/qmeu-disk
> > 
> > And make sure both report a non-zero result.  If either reports 0 as the
> > size, then you screwed up copying the file to your vfat partition.
> > 
> > Second:
> > 
> > In vl.h, change:
> > 
> > #ifndef O_LARGEFILE
> > #define O_LARGEFILE 0
> > #endif
> > 
> > To:
> > 
> > #ifdef O_LARGEFILE
> > #undef O_LARGEFILE
> > #endif
> > #define O_LARGEFILE 0
> > 
> > And if that fixes your problem, then vfat is broken when open()'d with
> > O_LARGEFILE.  If that's the case, you should report it as a vfat bug.
> > 
> > Regards,
> > 
> > Anthony Liguori
> > 
> > 
> > 
> > _______________________________________________
> > Qemu-devel mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 

-- Michael "Soruk" McConnell
   Eridani Star System

   MailStripper - http://www.MailStripper.eu/ - SMTP spam filter
   Mail Me Anywhere - http://www.MailMeAnywhere.com/ - Mobile email





reply via email to

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