HI,Sudhakar
Thanks for your immediate response.
Until now, the method seems work fine in format SDHC 8G attach a
parameter by block number .
But when i using format , i get a warning: (This can be ignored?)
# mkfs.vfat -F32 /dev/mmcblk0p1 8008371
mkfs.vfat 2.11 (12 Mar 2005)
Warning: block count mismatch: found 1048576 but assuming
8008371.
I think i should write a detecting code before using formating ,because
sometimes i don't know what kind of cards were inserted.
I feel this step is a little redundancy , could we just format without other
parameters ??
I guess maybe it's caused by some functions in sdio_memory ????
anyway, thanks very much for your answer.
2008/5/22 Rajashekhara, Sudhakar <[EMAIL PROTECTED]>:
> Goung,
>
> While running mkdosfs passing the number of blocks as an argument should
> solve your problem. The number of blocks can be obtained by running the
> fdisk command (4th column). The sample output of fdisk command when run on
> hda is shown below.
>
> [EMAIL PROTECTED]:~# fdisk /dev/hda
>
> The number of cylinders for this disk is set to 4864.
> There is nothing wrong with that, but this is larger than 1024,
> and could in certain setups cause problems with:
> 1) software that runs at boot time (e.g., old versions of LILO)
> 2) booting and partitioning software from other OSs
> (e.g., DOS FDISK, OS/2 FDISK)
>
> Command (m for help): p
>
> Disk /dev/hda: 40.0 GB, 40007761920 bytes
> 255 heads, 63 sectors/track, 4864 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hda1 1 4377 35158221 83 Linux
> /dev/hda2 4378 4864 3911827+ c W95 FAT32 (LBA)
>
> Regards, Sudhakar
>
> ________________________________________
> From: [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] On Behalf Of Goung
> Sent: Thursday, May 22, 2008 11:59 AM
> To: [email protected]
> Subject: Error in formating SDHC 8G card in DM6446??
>
> Hi,
> I am using Linux version 2.6.10_mvl401-davinci_evm and already using patch
> 045 from TI.
> It work fine in 2G SD card whit FAT32 or other file systems,
> but when i format SDHC 8G using FAT 32, it gets some troubles:
>
> The size is wrong , the message as follow:
>
> # ./mkdosfs -F 32 /dev/mmcblk0
> mkdosfs 2.11 (12 Mar 2005)
> # df -m
> Filesystem 1M-blocks Used Available Use% Mounted on
> /dev/mmcblk0 1022 0 1022 0% /mnt/sd
>
> And then i test read/write operation in /mnt/sd, it encounter the follow
> messages:
>
> #cp /mnt/sd/test.img /mnt/sd/test1.img (test.img size is 10MB)
> cp: Read error: Input/output error
>
> But when i using format in desktop (fedora core 6 in desktop) by usb card
> reader,
> the size is correct.
>
> #./mkdosfs -F 32 /dev/sda1
> # df -m
> Filesystem 1M-blocks Used Available Use% Mounted on
> /dev/mmcblk0 7807 0 7807 0% /mnt/sd
>
> and then i test read/write operation in /mnt/sd, everything is ok.
>
> I guess it may be wrong in MBR when format, but i don't know how to fix
> this problem.
>
> Any help will be very appreciated
> Thanks very much for your answer.
>
>
> ----------------------------------------------------- test log
> --------------------------------------------------
> ---using ext2 in 8G SDHC card --------
> #lsmod
> Module Size Used by Tainted: PF
> sdio_memory_fd 28032 0 - Live 0xbf03c000
> sdio_davinci_hcd 27388 0 - Live 0xbf034000
> sdio_busdriver 88528 2 sdio_memory_fd,sdio_davinci_hcd, Live 0xbf01d000
> sdio_lib 11232 3 sdio_memory_fd,sdio_davinci_hcd,sdio_busdriver, Live
> 0xbf019000
> dsplinkk 68632 0 - Live 0xbf007000
> cmemk 12476 0 - Live 0xbf002000
> dspon 1376 0 - Live 0xbf000000
>
> #mkfs.ext2 /dev/mmcblk0p1
> Filesystem label=
> OS type: Linux
> Block size=4096 (log=2)
> Fragment size=4096 (log=2)
> 1001920 inodes, 2002092 blocks
> 100104 blocks (5.00%) reserved for the super user
> First data block=0
> 62 block groups
> 32768 blocks per group, 32768 fragments per group
> 16160 inodes per group
> Superblock backups stored on blocks:
> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
>
> Writing inode tables: 0/62 1/62 2/62 3/62 4/62
> 5/62 6/62 7/62 8/62 9/62 10/62 11/62 12/62
> 13/62 14/62 15/62 16/62 17/62 18/62 19/62
> 20/62 21/62 22/62 23/62 24/62 25/62 26/62 27/62
> 28/62 29/62 30/62 31/62 32/62 33/62 34/62
> 35/62 36/62 37/62 38/62 39/62 40/62 41/62 42/62
> 43/62 44/62 45/62 46/62 47/62 48/62 49/62
> 50/62 51/62 52/62 53/62 54/62 55/62 56/62 57/62
> 58/62 59/62 60/62 61/62 done
> Writing superblocks and filesystem accounting information: done
>
> This filesystem will be automatically checked every 24 mounts or
> 180 days, whichever comes first. Use tune2fs -c or -i to override.
>
> #mount /dev/mmcblk0p1 /mnt/sd
> #mount |grep sd
> /dev/mmcblk0p1 on /mnt/sd type ext2 (rw,nogrpid)
>
> #df -m | grep sd
> /dev/mmcblk0p1 7698 0 7307 0% /mnt/sd
>
> #cp /tmp/ftp_temp/test.img /mnt/sd
> #cp /mnt/sd/test.img /mnt/sd/test2.img
> #df -m | grep sd
> /dev/mmcblk0p1 7698 36 7271 0% /mnt/sd
>
> Everythings is ok .
>
> ---------------------------------------using FAT32 in 8G SDHC card
> --------------------------------------
> #./mkdosfs -F32 /dev/mmcblk0p1
> mkdosfs 2.11 (12 Mar 2005)
> #mount /dev/mmcblk0p1 /mnt/sd
> #mount | grep sd
> /dev/mmcblk0p1 on /mnt/sd type vfat (rw,nodiratime,fmask=0033,dmask=0033)
> #df -m |grep sd
> /dev/mmcblk0p1 1022 0 1022 0% /mnt/sd
> #cp /tmp/ftp_temp/test.img /mnt/sd
> #cp /mnt/sd/test.img /mnt/sd/tes2.img
>
> The size of mount in sd folder is wrong with 1022 (0.99G).
>
> --
> Best Regards,
> Goung.
>
--
Best Regards,
Goung.
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source