[Ocfs-users] cp --o_direct
Bryce
philip.copeland at oracle.com
Wed Dec 1 11:28:54 CST 2004
I've two ocfs FS's mounted
[root at localhost root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda5 986080 564320 421760 58% /mnt
/dev/hda6 985984 836896 149088 85% /mnt2
[root at localhost root]# mount | grep ocfs
/dev/hda5 on /mnt type ocfs (rw)
/dev/hda6 on /mnt2 type ocfs (rw)
Ok lets crate a 256Mb test file on /mnt
[root at localhost root]# dd if=/dev/zero of=/mnt/testfile bs=1024
count=256
256+0 records in
256+0 records out
Now then lets copy it to another ocfs FS
[root at localhost root]# cp --o_direct /mnt/testfile /mnt2/testfile
Did it copy it correctly?
[root at localhost root]# md5sum --o_direct /mnt/testfile /mnt2/testfile
ec87a838931d4d5d2e94a04644788a55 /mnt/testfile
ec87a838931d4d5d2e94a04644788a55 /mnt2/testfile
Good. Now can we just drop it on /tmp?
[root at localhost root]# cp --o_direct /mnt/testfile /tmp
Hummmmm
One possibility is that the database file is not FS block sized aligned
but cp should have spotted that and bailed with an error if that was the
case.
Another possibility is that some other program has opened the database
WITHOUT O_DIRECT support. When this happens, O_DIRECT will not be
provided with a lock and it will bail out, at least until such time as
the non O_DIRECT program closes it's access to the database.
If all programs accessing/opening/modifying the file are using O_DIRECT
file access then you won't see this problem.
Phil
=--=
On Wed, 2004-12-01 at 17:04, David Sharples wrote:
> Thanks,
>
> When doing that command it works and the file gets copied.
>
> and yes I am using AS2.1. and /tmp is ext3
>
> However I get the same error(?) when I try to copy between two ocfs filesystems
>
> [oracle at LNCSTRTLDB03 tmp]$ cp /ocfs/oradata/LPTE3/odm01.dbf
> /ocfs4/oradata/LPTE3/
> cp: cannot stat `/ocfs/oradata/LPTE3/odm01.dbf': No such file or directory
> [oracle at LNCSTRTLDB03 tmp]$ cp /ocfs1/oradata/LPTE3/odm01.dbf
> /ocfs4/oradata/LPTE3/
> cp: cannot open `/ocfs1/oradata/LPTE3/odm01.dbf' for reading: Permission denied
> [oracle at LNCSTRTLDB03 tmp]$ cp --o_direct
> /ocfs1/oradata/LPTE3/odm01.dbf /ocfs4/oradata/LPTE3/
> cp: cannot open `/ocfs1/oradata/LPTE3/odm01.dbf' for reading: Permission denied
> [oracle at LNCSTRTLDB03 tmp]$ cp --o_direct=131072,0
> /ocfs1/oradata/LPTE3/odm01.dbf /ocfs4/oradata/LPTE3/
> [oracle at LNCSTRTLDB03 tmp]$
>
> just to prove that they are really ocfs :-)
>
> [root at LNCSTRTLDB03 root]# debugocfs -h /dev/sda1
> debugocfs 1.1.2-PROD1 Fri Apr 2 13:59:11 PST 2004 (build
> fcb0206676afe0fcac47a99c90de0e7b)
> diskheader:
> version = 1.2
> signature = OracleCFS
> mount_point = /ocfs1
>
> and
>
> [root at LNCSTRTLDB03 root]# debugocfs -h /dev/sda4
> debugocfs 1.1.2-PROD1 Fri Apr 2 13:59:11 PST 2004 (build
> fcb0206676afe0fcac47a99c90de0e7b)
> diskheader:
> version = 1.2
> signature = OracleCFS
> mount_point = /ocfs4
>
> Am i missing something here?
>
>
>
> On Wed, 01 Dec 2004 16:48:08 +0000, Bryce <philip.copeland at oracle.com> wrote:
> > *scratch*
> > lets see
> > try
> > cp --o_direct=131072,0 xdb01.dbf /tmp
> >
> > which basically says 'try to copy in the file using o_direct blocks of
> > 128Mb and copy out to /tmp without o_direct'
> >
> > --o_direct just by itself will assume that the src and destination FS's
> > are o_direct capable
> >
> > In your case, I'm assuming that /tmp isn't and is a ext2 or ext3 FS.
> > The use of fileutils suggests that you're using AS2.1 which did not
> > silently ignore o_direct on ext3 like EL3 does.
> >
> > Phil
> > =--=
> >
> >
> >
> > On Wed, 2004-12-01 at 15:43, David Sharples wrote:
> > > I have these versions.
> > >
> > > [root at LNCSTRTLDB03 LPTE3]# rpm -qa | grep tar
> > > tar-1.13.25-9
> > > [root at LNCSTRTLDB03 LPTE3]# rpm -qa | grep fileutils
> > > fileutils-4.1-10.23
> > > [root at LNCSTRTLDB03 LPTE3]#
> > >
> > > They were got from the coreutils page on oss today
> > >
> > > Thanks
> > >
> > >
> > > On Wed, 1 Dec 2004 07:37:31 -0800, Wim Coekaerts
> > > <wim.coekaerts at oracle.com> wrote:
> > > > that's odd. if you use odirect it should actually work maybe you ran
> > > > into another fileutils bug are you on the latest version ?
> > > > we need to be doing a better qa job on the fileutils
> > > >
> > > >
> > > >
> > > > On Wed, Dec 01, 2004 at 02:59:15PM +0000, David Sharples wrote:
> > > > > Another question.
> > > > >
> > > > > When my database is running, I do
> > > > >
> > > > > [oracle at LNCSTRTLDB03 LPTE3]$ cp --o_direct xdb01.dbf /tmp
> > > > > cp: cannot open `xdb01.dbf' for reading: Permission denied
> > > > > [oracle at LNCSTRTLDB03 LPTE3]$
> > > > >
> > > > > When the database is shudown it works.
> > > > >
> > > > > Is this normal for ocfs because with any other filesystem I can just
> > > > > copy a file at any time (Its only a testing, I know I cant copy
> > > > > datafiles and have them consistent)
> > > > >
> > > > > Thanks
> > > > > _______________________________________________
> > > > > Ocfs-users mailing list
> > > > > Ocfs-users at oss.oracle.com
> > > > > http://oss.oracle.com/mailman/listinfo/ocfs-users
> > > >
> > > _______________________________________________
> >
> >
> > > Ocfs-users mailing list
> > > Ocfs-users at oss.oracle.com
> > > http://oss.oracle.com/mailman/listinfo/ocfs-users
> >
> >
More information about the Ocfs-users
mailing list