Date: Tue, 9 Nov 2010 16:03:49 +0100 From: Monthadar Al Jaberi <monthadar@gmail.com> To: Bruce Evans <brde@optusnet.com.au>, olli@lurza.secnetix.de, ivoras@freebsd.org Cc: freebsd-fs@freebsd.org Subject: Re: problem mounting from flash [Invalid sectorsize] [g_vfs_done() ?error=22] Message-ID: <AANLkTi=MuiB6Xt3uztB7Yz82TvA2GJ9q6ncquU1=HTj9@mail.gmail.com> In-Reply-To: <20101110004642.H1101@besplex.bde.org> References: <201011091313.oA9DDUoc077095@lurza.secnetix.de> <20101110004642.H1101@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thank you for the clarifications! Definitely the right place to ask! I successfully tried mdconfig version, but gnop gives error message: gnop: Invalid secsize for provider redboot/fs. for any sectorsize that I give other than 64K, or multiples of 64K :/ RSPRO3# gnop create -s 128k -S 256k /dev/redboot/fs GEOM_NOP: Device redboot/fs.nop created. but that wont help mount... I looked into datasheet for the flash (MX25125805D) and it seems like it can work in both 64K and 4K? Confused. (http://www.macronix.com/QuickPlace/hq/PageLibrary482576EF002A2699.nsf/h_In= dex/30D2368B704F50B9482576EF002D070F/?OpenDocument&Type=3DSerial%20Flash&De= nsity=3D128Mb) Also I think the mx25 driver in freebsd is not configured correctly to my flash, Adrian Chadd had some diffs on his flash, but seems like for another slightly different flash. (http://people.freebsd.org/~adrian/rspro/) For example there is no CMD_BLOCK_ERASE_32K in datasheet for my flash. Would it help me if I changed the flash driver to work with 4K? Or do I still need to either, mdconfig, gnop or play UFS/UFS2 code (hard for me)? Basically I have a cross compiled kernel+mdroot with tinyBSD wireless configuration, zipped and stored on the flash. So I am trying to have a filesystem on the flash that will shadow changes. When I zipp it takes ~10M instead of 47M! br, On Tue, Nov 9, 2010 at 3:16 PM, Bruce Evans <brde@optusnet.com.au> wrote: > On Tue, 9 Nov 2010, Oliver Fromme wrote: > >> Bruce Evans wrote: >> > On Mon, 8 Nov 2010, Oliver Fromme wrote: >> > > Monthadar Al Jaberi <monthadar@gmail.com> wrote: >> > > > [...] >> > > > mount: /dev/redboot/fs Invalid sectorsize 65536 for superblock siz= e >> > > > 8192: Invalid argument >> > > > >> > > > So I guessed it has todo with the flash configured in 64k sectors >> > > > according to the boot output. >> > > > ... >> > > > mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0 >> > > > mx25l0: mx25ll128, sector 65536 bytes, 256 sectors >> > > > ... >> > > >> > > Historically UFS/FFS supports only 512 bytes per sector. >> > > I think it was patched at some point in the past to support >> > > 2048 bytes per sector, too, which is used by some MOD media >> > > and DVD-RAM. =A0I'm pretty sure it does _not_ support 65536 >> > > bytes per sector (someone please correct me if I'm wrong). >> > >> > Maybe 25 years ago, but in Net2/ 20 years ago ffs doesn't really >> > even use sectors. =A0It just has a buggy superblock probe which >> > prevents it determining its correct i/o size when that size >> > exceeds SBLOCKSIZE =3D 8192. >> >> In the second half of the 90s it did *not* support the >> 2048-byte sectors of the larger MOD media that became >> popular at that time. =A0I owned several of those drives >> (still have one of them), so I remember it quite well. >> FreeBSD's file system code needed some patches in order >> to be able to use those disks. =A0Before that, only 512- >> byte sectors worked. > > That's strange, since in the initial slice code in 1994 or 1995, I > emulated 4K-sectors in uncommitted patches in the floppy driver and > thought I tested ffs with them. > >> I don't know what sector sizes are supported today, but >> I wouldn't be surprised if only 512 to 2048 works out >> of the box. =A0I'm not aware of any widely used media >> that has sectors smaller than 512 or larger than 2048. >> (Those new 4k drives translate accesses to/from 512 byte >> sectors, so it looks like a 512-byte sector drive.) > > I have a DVD drive that only supports writing 32K-blocks on DVD-R. =A0In > 2005 I gave up trying to get ffs to work on this. =A0The drive supports > reading the usual 2K-blocks, so the ffs probe worked, and the ffs block > size just needed to be set to 32K or 64K so that writes worked too. > But this block size wastes a lot of space and time for small files. > FreeBSD's buffering is bad for read-mostly media, and I never found > any file system that works well for small files on DVDs or CDROMs > (images that can be written in 10 minutes take more like 10 hours > to read back if they contain a few hundred thousand small files). > > mdconfig allows any representable sector size except 0 and possibly non- > power-of-2 ones (mdconfig(8) uses strtoul() with null error handling; > md(4) checks for a power of 2 in the malloc-backed case but has null > arg checking in other cases (if other cases are reached now -- this > feature used to be limited to the malloc-backed case)). =A0Power of 2 > sizes that cannot work because they exceed MAXBSIZE can certainly be > configured. > > Bruce > --=20 //Monthadar Al Jaberi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=MuiB6Xt3uztB7Yz82TvA2GJ9q6ncquU1=HTj9>