Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Feb 2008 12:19:14 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Joe Marcus Clarke <marcus@freebsd.org>
Cc:        freebsd-gnome@freebsd.org
Subject:   Re: hal vs. fat32 formatted dvd-ram
Message-ID:  <47C7DC22.2080404@icyb.net.ua>
In-Reply-To: <47C71FEC.2000404@freebsd.org>
References:  <47C71B42.1010402@icyb.net.ua> <47C71C53.8030809@freebsd.org> <47C71D6F.3040701@icyb.net.ua> <47C71FEC.2000404@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 28/02/2008 22:56 Joe Marcus Clarke said the following:
> Andriy Gapon wrote:
>> on 28/02/2008 22:40 Joe Marcus Clarke said the following:
>>> Andriy Gapon wrote:
>>>> Using a path described in the following PR I formatted complete DVD-RAM
>>>> disk with FAT32:
>>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=121182
>>>>
>>>> Now when I insert the disk hald tastes it for a very long time (much
>>>> longer that I've seen ever before) and in the end it can not detect the
>>>> filesystem.
>>>>
>>>> lshal shows this "volume.disk" device, but nothing under it:
>>>> udi = '/org/freedesktop/Hal/devices/storage_model_DVDRAM_GSA_4163B_block'
>>>>   block.storage_device =
>>>> '/org/freedesktop/Hal/devices/storage_model_DVDRAM_GSA_4163B'  (string)
>>>>   info.product = 'Block Device'  (string)
>>>>   info.udi =
>>>> '/org/freedesktop/Hal/devices/storage_model_DVDRAM_GSA_4163B_block'
>>>> (string)
>>>>   block.is_volume = false  (bool)
>>>>   volume.disc.capacity = 4580769792  (0x111090000)  (uint64)
>>>>   volume.disc.type = 'dvd_ram'  (string)
>>>>   volume.disc.is_rewritable = true  (bool)
>>>>   volume.disc.is_blank = false  (bool)
>>>>   volume.disc.is_appendable = false  (bool)
>>>>   volume.disc.is_videodvd = false  (bool)
>>>>   volume.disc.is_svcd = false  (bool)
>>>>   volume.disc.is_vcd = false  (bool)
>>>>   volume.disc.has_data = true  (bool)
>>>>   volume.disc.has_audio = false  (bool)
>>>>   block.minor = 94  (0x5e)  (int)
>>>>   block.major = 0  (0x0)  (int)
>>>>   block.device = '/dev/cd1'  (string)
>>>>   info.category = 'volume.disc'  (string)
>>>>   info.bus = 'block'  (string)
>>>>   info.capabilities = {'block', 'volume', 'volume.disc'} (string list)
>>>>   info.parent =
>>>> '/org/freedesktop/Hal/devices/storage_model_DVDRAM_GSA_4163B'  (string)
>>>>
>>>> And:
>>>> $ file -s /dev/cd1
>>>> /dev/cd1: x86 boot sector, code offset 0x58, OEM-ID "BSD  4.4",
>>>> Bytes/sector 2048, sectors/cluster 2, heads 255, sectors 2236704
>>>> (volumes > 32 MB) , FAT (32 bit), sectors/FAT 2181, Backup boot sector
>>>> 2, serial number 0x7fbf1210, label: "SHUTTLE32  "
>>>>
>>>> I can provide any additional required debugging info.
>>> HAL will wait 60 seconds before it times out the volume probe helper. 
>>> If it takes longer for the probe to determine the file system, then the 
>>> detection will fail.  You can increase this in hald/freebsd/hf-volume.c 
>>> by increasing the PROBE_VOLUME_TIMEOUT multiplier.  The 
>>> HAL_HELPER_TIMEOUT is 10 seconds.
>> Thank you! I'll try that. But I actually still wonder what could take so
>> long to recognize FAT32 fs. For example, cd9660 and udf on the same
>> media are recognized very fast, and fat32 on usb stick stick is
>> recognized very fast too.
>> So it seems that there might be something unexpected for hal in this
>> combo (dvd-ram+fat32). Maybe it's block size (2048), maybe something else.
> 
> The way FreeBSD works, one cannot read from raw media using any block 
> size.  You must use the actual block size on the media.  With UDF and 
> ISO9660, this is not a problem.  This might fail for FAT32 on DVD media. 
>     If you find that the probe runs to completion, and still doesn't 
> detect the correct file system, you can dig around in the libvolume_id 
> code and try to fix this problem.

I've tracked it down, it's not in libvolume_id, it's after it.
probe-volume.c:
      if (has_data)
        hf_probe_volume_advanced_disc_detect(fd);

hf_probe_volume_advanced_disc_detect essentially reads a disk sector by
sector starting at certain offset and searching for ISO FS specific magic.
This definitely works for CD9660.
This perhaps/probably works for UDF.
This doesn't work for FAT32, the search goes on till the end of media
(which is a lot).
I think it is a mistake to assume that any CD/DVD media with data must
carry ISO FS. Especially DVD-RAM media.
I think that we should check vid->type (which should be available at the
moment) and call hf_probe_volume_advanced_disc_detect only for specific
filesystems.


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47C7DC22.2080404>