|
Thanks for your quick response mate, i have some output from petalinux
based of a couple commands that may be of further interest, although do
not explain this behavior of the mount command. # mount -t jffs2 /dev/mtd5 /usr mount: Mounting /dev/mtd5 on /usr failed: No such device # mount -t jffs2 /dev/mtdblock5 /usr mount: Mounting /dev/mtdblock5 on /usr failed: No such device -- so either way, "no such device" is returned & btw - from reading i think mounting using the char device is meant to have some benefit to performance as far as flash devices are concerned due to the physical nature of the medium, and in this case, it think the JFFS2 driver always uses char access to the device instead of emulating block. but more interesting is the fact that if i remove the "-t JFFS2" option - now it asks me for a block device... this suggests that maybe JFFS2 is indeed designed to handle the /dev/mtd5 char device node. # mount /dev/mtd5 /usr mount: Mounting /dev/mtd5 on /usr failed: Block device required and last but least, if i give it a block device version of the mtd patition, suddenly the device exists, it just can't find a ext2/romfs/cramfs file system on the partition - fair enough, after all that partition is loaded with a JFFS2 image, but why does the device sudenly cease to exist when i try to mount it using the "-t JFFS2" option # mount /dev/mtdblock5 /usr VFS: Can't find an ext2 filesystem on dev mtdblock5. cramfs: wrong magic VFS: Can't find a romfs filesystem on dev mtdblock5. mount: Mounting /dev/mtdblock5 on /usr failed: Invalid argument what do you think? - all input welcome! Cheers, Mike. Steven J. Magnani wrote: On Thu, 2009-09-17 at 17:39 +0200, Michael Allwright wrote:G'day All This is a question that has been going around for awhile without any solution, and i think its about time it was solved and posted onto the web. The problem is related to mounting partitions in Petalinux, in this particular example we are running petalinux off a Spartan 3A DSP 1800a development board using bitstream configuration from BPI flash. The target partition to mount is to be formated to JFFS2 to provide a persistant storage for applications, config etc The BPI flash, is a 128Mbit = 16MByte NOR parallel flash device from intel, and goes by the model number JS28F128J3D. As shown below, at the current configuration stage, BPI has been partitioned, bitstream loaded onto mtd0, uboot loaded and configured in mtd1-3, and linux kernel sitting in mtd4. The system is configured and automatically boots straight into petalinux on power on. the target partition is approx 10MBytes (slight larger) located on mtd5 and is to be setup up with a JFFS2 file system # cat /proc/mtd dev: size erasesize name mtd0: 00100000 00020000 "fpga" mtd1: 00040000 00020000 "boot" mtd2: 00020000 00020000 "bootenv" mtd3: 00020000 00020000 "config" mtd4: 00400000 00020000 "image" mtd5: 00a80000 00020000 "home" /* JFFS2 file system here */ mtd6: 0015d000 00001000 "ROMfs" Also shown below the output of the "cat /proc/partitions" - i don't think this shows much useful information. # cat /proc/partitions major minor #blocks name 31 0 1024 mtdblock0 31 1 256 mtdblock1 31 2 128 mtdblock2 31 3 128 mtdblock3 31 4 4096 mtdblock4 31 5 10752 mtdblock5 31 6 1396 mtdblock6 # auto-config has been used and the uboot recognises the partitions passing theses into the kernel on boot. the JFFS2 image was build on a pc using the following command: "mkfs.jffs2 -r ~/workspace/flashData/jffs2_image/ -o home.jffs2 -e 128 -b --pad=10485760" where, "-r ~/workspace/flashData/jffs2_image/" was the source directory for the image containing a text file for testing purposes "-o home.jffs2" is the output image file "-e 128" was erase block size - set to 128 following the JS28F128J3D BPI datasheet specifications "-b" for big endian format - same as the microblaze processor "--pad=10485760" was to pad the image file up to 10Mbytes, to create a 10Mbyte partition I've hosted this image file for your inspection: http://allsey.homeip.net/uploaded%20data/home.jffs2 I have written this image to flash in a couple of ways 1. From uboot using tftp $(clobstart) home.jffs2 erase $(homestart) +$(homesize) cp.b $(clobstart) $(homestart) 0x00A00000 - where homesize and homestart are variables i calculated and stored using the setenv cmd and 0x00A00000 is 10MBytes in bytes in hex. 2. In linux, using wget to download the home.jffs2 to /var directory (linked to RW RAMfs) erased partition using "eraseall /dev/mtd5" then attempted to use flashcp to find this is not built into the petalinux mtd-utils - is there any reason to why this is the case? from here i used "dd if=/var/home.jffs2 of=/dev/mtdblock5" instead - this seems to works and returns to stdout 20480+0 records in 20480+0 records out Either way the main problem is when i write the command: "mount -t jffs2 /dev/mtd5 /usr" it returns the error: mount: Mounting /dev/mtd5 on /usr failed: No such device Now this error just doesn't make sense to me, i mean how is that writting the image and erasing seems to work fine, but come time to mount - it suddenly doesn't exist anymore...Maybe the problem is the mount command.../dev/mtd5 is a char device. Try /dev/mtdblock5 instead. |