Unable to make SDCARD

Hi,

I have just now purchased new beagle board xm. I want to use 2GB sd
card but unable to make out dual partition. I am using mkcard.txt file
which has following contents.

Hi,

I have just now purchased new beagle board xm. I want to use 2GB sd
card but unable to make out dual partition. I am using mkcard.txt file
which has following contents.

#
#
#
#
if [ $# -eq 0 ]
then
echo "Example Usage : $0 /dev/sdc"
exit 1
else
DRIVE=$1
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo "DISK SIZE - $SIZE bytes"
CYLINDERS=`echo $SIZE/255/63/512 | bc`
echo CYLINDERS - $CYLINDERS
{
echo ,9,0x0C,* echo ,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
mkfs.vfat -F 32 -n "boot" ${DRIVE}1
mke2fs -j -L "rootfs" ${DRIVE}2
fi

I am getting following error.

[root@localhost beagle]# sh sds.sh /dev/sdc
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 1.27945 seconds, 820 kB/s
Disk /dev/sdc doesn't contain a valid partition table
DISK SIZE - 1977614336 bytes
CYLINDERS - 240
Checking that no-one is using this disk right now ...
OK
Disk /dev/sdc: 240 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdc: unrecognized partition table type

[Joel]
This first error is normal as there is nothing on the disk yet.

Old situation:
No partitions found
trailing junk after number
sfdisk: bad input

[Joel]
This is not right. Can you invoke the script with "sh -x" and paste
what you get?

Most likely something wrong with sfdisk's args.

Run:
sh -x sds.sh /dev/sdc

mkfs.vfat 2.11 (12 Mar 2005)
/dev/sdc1: No such file or directory
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sdc2 --- No such file or directory
The device apparently does not exist; did you specify it correctly?

Irrelevant as the sfdisk didn't complete.

-Joel

Hi Vishal,

You can try the below link;-
http://processors.wiki.ti.com/index.php/How_to_Make_3_Partition_SD_Card

If the card is new then i think you manually format once in ext2.
Then may be this problem get solve…

Thanks,
Lokesh

looks like what happens to me when I forget “sudo”.

sudo ./mkcard.txt