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: davinci-linux-open-source@linux.davincidsp.com
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/6210/6211/6212/6213/6214/6215/6216/6217/6218/6219/6220/6221/6222/6223/6224/6225/6226/6227/6228/6229/6230/6231/6232/6233/6234/6235/6236/6237/6238/6239/6240/6241/6242/6243/6244/6245/6246/6247/6248/6249/6250/6251/6252/6253/6254/6255/6256/6257/6258/6259/6260/6261/62done
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.
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to