Hi,
Solaris7 by default provides filesystem logging option. I mount a
filesystem with "-o logging" option and then crash the filesystem. For
crashing, while a copy of a directory is going on to the filesystem I
power off the machine. Next time i am able to mount the same filesystem
without having to do an fsck.
But the same does not happen if i mount the filesystem with mount
(2) system call with the flag MNTOPT_LOGGING. Sample code is below
--------------Ex code ---------------
struct ufs_args ufs_mount;
ufs_mount.flags = UFSMNT_LARGEFILES|UFSMNT_LOGGING;
length = sizeof(ufs_mount);
mount(dev[i],mntpoint[i],MS_DATA,filesys,(char *)&ufs_mount,length);
-----------------------------------------
I could avoid this by following the below steps:
1. mount the required filesystem with mount(1) command
mount -o logging /dev/dsk/c1t5d0s0 /mnt
2. Do some activity on it. ex cp,rm and then unmount.
3. Now use the mount(2)system call and mount the filesystem(above prog).
After following these steps even if the filesystem crashed it can
be mounted next time with the mount(2) system call without an fsck(1).
I have also observed that a filesystem mounted using mount(2) call
very frequently gives a "ufs log error , errno = 5" and needs an fsck
after very few crashes.
I have tried this on both 32 & 64 bit Solaris7.
thanks in advance,
rakesh.
Sent via Deja.com http://www.deja.com/
Before you buy.