This is not a yaffs issue, but a general Linux one. You can't unmount a file system when it is busy (eg. Open files or busy directory). The other questions here are: 1) Why do you ever need to unmount a yaffs file system? The only time I can see you'd want to do this is if it is removable media or to reformat. 2) Why do you need to reformat? You should not need to reformat yaffs devices. If you just rm -rf the mount point you should get a completely purged file system. The main reason you need to reformat a FAT file system is because the FAT formatting gets screwed up. YAFFS does not have FAT tables etc to get screwed up. If this is really intended as a way to completely erase the flash then you either need to find a way of un-busying the file system to unmount it or you could perhaps do something "Windows-like" and do a reboot and erase the flash before mounting it. -- Charles > -----Original Message----- > From: Abhishek Bhattacharya [mailto:abhishek.b@lgsoftindia.com] > Sent: Tuesday, 11 January 2005 5:28 p.m. > To: Charles Manning > Subject: RE: [Yaffs] "Formatting the flash" > > > exactly, what I am trying to point out sir! Let me try to > make my point clearer by citing an example. Suppose, my root > directory is "boot/" At any point of time if we say > yaffs_unmount("/boot"), it will fail, as you said. As long as > the FS is active root directory stays, right! Then how do we > counter that? And the rest of the ugly stuff just follows, > after unmount. Thanks -----Original Message----- > From: Charles Manning [mailto:Charles.Manning@trimble.co.nz] > Sent: Tuesday, January 11, 2005 9:49 AM > To: Abhishek Bhattacharya > Cc: yaffs@lists.aleph1.co.uk > Subject: RE: [Yaffs] "Formatting the flash" > > > Unmount should not fail unless files are open or the > direcetory is busy (eg. It is a current directory). > > A failed unmount is something you will need to address. If > you try erasure while a file system is mounted then bad > things will happen because the Linux internals (VFS) will get > out of step with the file system. > > > > -----Original Message----- > > From: Abhishek Bhattacharya [mailto:abhishek.b@lgsoftindia.com] > > Sent: Tuesday, 11 January 2005 5:06 p.m. > > To: Charles Manning > > Subject: RE: [Yaffs] "Formatting the flash" > > > > > > Hello Charles > > > > Thanks for the reply, but if you try an unmount operation > > after you have created some files and directories, it fails. > > What can be the reason for failing of unmount. If you try to > > erase the flash , it will throw up an exception. thanks abhishek > > > > -----Original Message----- > > From: Charles Manning [mailto:Charles.Manning@trimble.co.nz] > > Sent: Tuesday, January 11, 2005 12:19 AM > > To: Abhishek Bhattacharya; yaffs@stoneboat.aleph1.co.uk > > Subject: RE: [Yaffs] "Formatting the flash" > > > > > > To format YAFFS is easy - just erase all non-bad blocks. > > > > If you unmount a fs, then all the dentry stuff etc is purged > > from the Linux kernel. > > > > A sequence like: > > Unmount > > Erase > > Mount > > > > should work fine, I'd think. > > > > > > > > -----Original Message----- > > From: yaffs-admin@stoneboat.aleph1.co.uk > > [mailto:yaffs-admin@stoneboat.aleph1.co.uk] On Behalf Of > > Abhishek Bhattacharya > > Sent: Tuesday, 11 January 2005 3:25 a.m. > > To: yaffs@stoneboat.aleph1.co.uk > > Subject: [Yaffs] "Formatting the flash" > > > > > > Hello All > > I have a query . Suppose at any point of time , the user > > wants to erase the complete flash, and restart( or in other > > words format the flash). > > > > Now my idea is that ,this is not possible , at run time. > > I presume we might have to use yaffs_unmount(), to > > deinitialise, YAFFS.But will it work to deinitialise all > > current directories and other objects?? Any suggestions as to > > how to go about a DiskFormat function if required?? > > Abhishek > > > > > > > > > > > >