Skip to contentSkip to conversation

problem with vvfat and plan9

Qemu-devel Jens Arm 3 participants 4 messages Jan 12, 2006 – Oct 15, 2011

lore
Share & tools
lore

Jens Arm

author
#0 lore raw

Hi

The vvfat driver has wrong partition table entry for plan9. When booting I get the error:

cannot add sdC1!dos [63,966798) to disk [0,966735): partition boundaries out of range

In Linux the vvfat driver works, but plan9 is refusing to use the first partition, because the wrong entry.

In Linux fdisk -l says the same wrong data:

Disk /dev/hdb: 494 MB, 494968320 bytes
15 heads, 63 sectors/track, 1023 cylinders
Units = cylinders of 945*512 = 483840 bytes

device    boot start   end    blocks   id  system
/dev/hdb1  *    1      1024   483367+  6  FAT16

Partition 1 has different physical/logical endings:
phys=(1023,14,63) logical=(1023,0,63)

How could the vvfat driver be made working in plan9 ?

Jens

#1 lore raw

Hi,

Quoted 2 lines · Jens Arm

cannot add sdC1!dos [63,966798) to disk [0,966735): partition boundaries out of range

Note that the difference of the larger numbers is exactly 63...

It might be fixed by replacing the line

    s->sector_count=0xec04f;

with

    s->sector_count=0xec04f - 63;

in block-vvfat.c, but I can't tell all the implications right now. If you feel lucky, you can try it, but I'll have a look anyway.

Ciao,
Dscho

author
#2 lore raw
Quoted 7 lines
Quoted 2 lines

cannot add sdC1!dos [63,966798) to disk [0,966735): partition boundaries out of range

Note that the difference of the larger numbers is exactly 63...

It might be fixed by replacing the line

Quoted 8 lines
    s->sector_count=0xec04f;

with

    s->sector_count=0xec04f - 63;

in block-vvfat.c, but I can't tell all the implications right now. If you feel lucky, you can try it, but I'll have a look anyway.

I have tested this little fix with plan9 and now it works. I have found no errors e.g. with Linux or so in qemu. Looks like it is working correctly.

Then I have tried to test the :rw: with plan9, but nothing is written into the host filesystem. I have enabled debug in vvfat and there I see that the newly created file in plan9 mounted vvfat-drive is shown in the log. But I do not see the commit message which in the log is shown if I try with linux.

Jens

#3 lore raw

[Qemu-devel] [QEMU] VVFAT help required

In reply to Johannes Schindelin

Dear Mr. Johannes Schindelin,

I needed your help in understanding and doing few modifications in VVFAT (vvfat.c).

I am working for Samsung india for Linux mobile platform division. We wanted to experiment on VVFAT and plan to integrate it for one of our Linux mobile platform.
But before that we wanted to do some modifications with the current implementation on VVFAT.

Our major requirement:
We wanted to share ext4 partition content on Linux mobile to Windows PC (which recognises FAT file system only) when connected through USB cable and without network support.
We found that VVFAT is best suited for this purpose.

Our current modifications:
We started with latest version of VVFAT and did few modifications for our platform:
We divided the VVFAT into 2 part : VVFAT block driver + VVFAT daemon. VVFAT block driver performs ext4 block layer operation.
VVFAT daemon scans the ext4 directory structure and build the mapping for FAT table.
Then we run the deamon by specifying our target directory of ext4 as follows:

# ./vvfatd  /opt/targetdir  &
Then we mount vvfat as follows:
/dev/vvfat              515584        48    515536   0% /mnt/movifs

Here /mnt/movifs is the partition which will be accessible to Windows using USB connection.

But we found that if our ext4 targetdir is very huge (which normally is and may grow in future) then mounting using vvfat takes long time.
After analysis we found that VVFAT scans and maps all the files directories and sub-directories in targetdir in the beginning itself.
Thus mounting all these content take huge time.

We wanted to change this approach.
We wanted to perform only partial scanning in the beginning. That is scanning and mapping only the top level files and directory. And do not scan the sub- directory content except the _dot_ and _dotdot_ entries.
Then we wanted to introduce on-demand scanning and mapping of sub-directories whenever that particular sub-directory is accessed by the guest OS. This will help us to reduce the mount time initially and also scan and create mapping only when it is required.

We could able to achieve part 1 that is partial scanning in the beginning. But we are facing problem during on-demand scanning and mapping.

We wanted to know if this kind of partial scanning and dynamic scanning is possible to implement in VVFAT.

Please let me know your thoughts and suggestions to proceed further.

Please let me know if you need more information.

Thank you very much.

Thanks, Regards,
Pintu Kumar