[opensuse] mv and cpio have new behavior. How do I get the old back?
Hello,
I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I
could do a mv and it retained the orignal date/time. Now moving the
directory changes times. I have to do a cpio to get things to stay. When
you transfer 450 GB it becomes a real problem. I only have a 1TB drive.
Once I finish getting things to this drive I will not be able to do a
cpio.
Also cpio no longer honors -pdum. I have to use
cpio -p --make-directories --preserve-modification-time
A real pain to type and prone to mistakes. Why has the long honored
methods been change. I really hate this new behavior. I do not want to
go back to 10.0 to just to transfer everything to this drive. What can I
do to get the orignal behavior back with mv and cpio?
Thanks,
--
Boyd Gerber
Am Dienstag, 25. März 2008 schrieb Boyd Lynn Gerber:
[...] I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I could do a mv and it retained the orignal date/time. Now moving the directory changes times. [...]
I cannot reproduce this using 10.3 and ext3: jan@karl:~/tmp> l insgesamt 1724 drwx------ 3 jan users 4096 16. Feb 14:09 ./ drwxr-xr-x 49 jan users 4096 25. Mär 18:33 ../ drwxr-xr-x 12 jan users 4096 16. Feb 14:07 diplomarbeiten/ [...] jan@karl:~/tmp> mv -i diplomarbeiten da jan@karl:~/tmp> l insgesamt 1724 drwx------ 3 jan users 4096 25. Mär 19:00 ./ drwxr-xr-x 49 jan users 4096 25. Mär 18:33 ../ drwxr-xr-x 12 jan users 4096 16. Feb 14:07 da/ [...] Gruß Jan -- The hidden flaw never remains hidden. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 25 Mar 2008, Jan Ritzerfeld wrote:
Am Dienstag, 25. März 2008 schrieb Boyd Lynn Gerber:
[...] I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I could do a mv and it retained the orignal date/time. Now moving the directory changes times. [...]
I cannot reproduce this using 10.3 and ext3: jan@karl:~/tmp> l insgesamt 1724 drwx------ 3 jan users 4096 16. Feb 14:09 ./ drwxr-xr-x 49 jan users 4096 25. Mär 18:33 ../ drwxr-xr-x 12 jan users 4096 16. Feb 14:07 diplomarbeiten/ [...] jan@karl:~/tmp> mv -i diplomarbeiten da jan@karl:~/tmp> l insgesamt 1724 drwx------ 3 jan users 4096 25. Mär 19:00 ./ drwxr-xr-x 49 jan users 4096 25. Mär 18:33 ../ drwxr-xr-x 12 jan users 4096 16. Feb 14:07 da/ [...]
try something like...
mkdir .org
mv da .org/
or
mv da .org/da
The times in the .org/da will change to the current date/time.
or
mkdir /home/test
mv da /home/test/
or
mv da /home/test/da
The times change.
--
Boyd Gerber
Am Dienstag, 25. März 2008 schrieb Boyd Lynn Gerber:
[...] mkdir .org mv da .org/
or
mv da .org/da
The times in the .org/da will change to the current date/time.
jan@karl:~/tmp> mkdir .org jan@karl:~/tmp> mv da .org/da jan@karl:~/tmp> l .org insgesamt 12 drwxr-xr-x 3 jan users 4096 25. Mär 19:34 ./ drwx------ 3 jan users 4096 25. Mär 19:34 ../ drwxr-xr-x 2 jan users 4096 16. Feb 14:07 da/
or
mkdir /home/test mv da /home/test/
jan@karl:~/tmp> mkdir /home/jan/test jan@karl:~/tmp> mv .org/da /home/jan/test/ jan@karl:~/tmp> l /home/jan/test/ insgesamt 12 drwxr-xr-x 3 jan users 4096 25. Mär 19:36 ./ drwxr-xr-x 50 jan users 4096 25. Mär 19:36 ../ drwxr-xr-x 2 jan users 4096 16. Feb 14:07 da/
or
mv da /home/test/da
jan@karl:~/tmp> mv /home/jan/test/da .org/ jan@karl:~/tmp> l .org insgesamt 12 drwxr-xr-x 3 jan users 4096 25. Mär 19:37 ./ drwx------ 3 jan users 4096 25. Mär 19:34 ../ drwxr-xr-x 2 jan users 4096 16. Feb 14:07 da/ jan@karl:~/tmp> mv .org/da/ /home/jan/test/da jan@karl:~/tmp> l /home/jan/test/ insgesamt 12 drwxr-xr-x 3 jan users 4096 25. Mär 19:37 ./ drwxr-xr-x 50 jan users 4096 25. Mär 19:36 ../ drwxr-xr-x 2 jan users 4096 16. Feb 14:07 da/
The times change.
Not for me. Even if I move beyond two partitions, e.g., /home and /. Strange. Gruß Jan -- Never underestimate the power of a small tactical nuclear weapon. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Boyd Lynn Gerber wrote:
Hello,
I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I could do a mv and it retained the orignal date/time. Now moving the directory changes times. I have to do a cpio to get things to stay. When you transfer 450 GB it becomes a real problem. I only have a 1TB drive. Once I finish getting things to this drive I will not be able to do a cpio.
Also cpio no longer honors -pdum. I have to use cpio -p --make-directories --preserve-modification-time
What is the output of the "mount" command, please? Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 25 Mar 2008, Sloan wrote:
Boyd Lynn Gerber wrote:
I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I could do a mv and it retained the orignal date/time. Now moving the directory changes times. I have to do a cpio to get things to stay. When you transfer 450 GB it becomes a real problem. I only have a 1TB drive. Once I finish getting things to this drive I will not be able to do a cpio.
Also cpio no longer honors -pdum. I have to use cpio -p --make-directories --preserve-modification-time
What is the output of the "mount" command, please?
suse103:~ # mount
/dev/sda2 on / type ext3 (rw,acl,user_xattr,commit=0)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sdb2 on /MNT0 type ext3 (rw,acl,user_xattr,commit=0)
/dev/sdb3 on /MNT1 type xfs (rw)
/dev/sda3 on /home type xfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
--
Boyd Gerber
Boyd Lynn Gerber wrote:
On Tue, 25 Mar 2008, Sloan wrote:
Boyd Lynn Gerber wrote:
I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I could do a mv and it retained the orignal date/time. Now moving the directory changes times. I have to do a cpio to get things to stay. When you transfer 450 GB it becomes a real problem. I only have a 1TB drive. Once I finish getting things to this drive I will not be able to do a cpio.
Also cpio no longer honors -pdum. I have to use cpio -p --make-directories --preserve-modification-time
What is the output of the "mount" command, please?
suse103:~ # mount /dev/sda2 on / type ext3 (rw,acl,user_xattr,commit=0)
/dev/sdb2 on /MNT0 type ext3 (rw,acl,user_xattr,commit=0) /dev/sdb3 on /MNT1 type xfs (rw) /dev/sda3 on /home type xfs (rw)
OK, you've got xfs and ext3, check - which partition displayed the symptoms you posted? Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 25 Mar 2008, Sloan wrote:
Boyd Lynn Gerber wrote:
On Tue, 25 Mar 2008, Sloan wrote:
Boyd Lynn Gerber wrote:
I am on openSUSE 10.3 and I really hate the current behavior. On 10.0 I could do a mv and it retained the orignal date/time. Now moving the directory changes times. I have to do a cpio to get things to stay. When you transfer 450 GB it becomes a real problem. I only have a 1TB drive. Once I finish getting things to this drive I will not be able to do a cpio.
Also cpio no longer honors -pdum. I have to use cpio -p --make-directories --preserve-modification-time
What is the output of the "mount" command, please?
suse103:~ # mount /dev/sda2 on / type ext3 (rw,acl,user_xattr,commit=0)
/dev/sdb2 on /MNT0 type ext3 (rw,acl,user_xattr,commit=0) /dev/sdb3 on /MNT1 type xfs (rw) /dev/sda3 on /home type xfs (rw)
OK, you've got xfs and ext3, check - which partition displayed the symptoms you posted?
Both, but I am mainly using the xfs. I have a lot of small files. The
files themselves keep their times, but the directories all change.
--
Boyd Gerber
Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
I don't know if that's new, but it seems reasonable for the directory to change timestamp when the contents of the directoy changes. /Per Jessen, Zürich -- http://www.spamchek.com/ - your spam is our business. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
I don't know if that's new, but it seems reasonable for the directory to change timestamp when the contents of the directoy changes.
But the directory being moved should not change timestamp, its contents don't change -- it merely gets unlinked from one parent directory into a new parent directory...but the directory itself doesn't change. Hmmm, maybe it's because dirname/.. get modified (from the old parent directory to the new parent directory).
/Per Jessen, Zürich
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 25 Mar 2008, Per Jessen wrote:
Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
I don't know if that's new, but it seems reasonable for the directory to change timestamp when the contents of the directoy changes.
I do not mind the timestamp changing on the directory the files are moved
into, but to change the timestamp on all directories of the moved
directory and below should not change. After all, all I want is to move
the directory to a different directory.
I used the timestamp as a method of telling when the files within were
created. This makes it really hard to tell what really is in the
directory. I have source code from 1996. When the timestamp changes it
makes me think I have changed something in the directory. I really have
not. It makes keeping track of things a lot hard. I did not notice the
timestamp change till I was looking for the differences between my working
directory and the orignal. I could not tell which was which when the
timestamps changed. It is making my development a lot harder.
--
Boyd Gerber
On Tuesday 25 March 2008 12:28, Boyd Lynn Gerber wrote:
...
I do not mind the timestamp changing on the directory the files are moved into, but to change the timestamp on all directories of the moved directory and below should not change. After all, all I want is to move the directory to a different directory.
Because every directory contains a link to its parent ("..") and because links reference their targets by their inode number, if you move a directory across file systems, then all those ".." links have to be recreated. In fact, moving a directory across file system requires a recursive copy. If you're relocating directory hierarchies in bulk across file system boundaries, use "cp." It has the flexible "--preserve=" option that allows you to control exactly how much of the original files' metadata is copied along with the file's contents.
...
-- Boyd Gerber
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Boyd Lynn Gerber wrote:
On Tue, 25 Mar 2008, Per Jessen wrote:
Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
I don't know if that's new, but it seems reasonable for the directory to change timestamp when the contents of the directoy changes.
I do not mind the timestamp changing on the directory the files are moved into, but to change the timestamp on all directories of the moved directory and below should not change. After all, all I want is to move the directory to a different directory.
I used the timestamp as a method of telling when the files within were created. This makes it really hard to tell what really is in the directory. I have source code from 1996. When the timestamp changes it makes me think I have changed something in the directory. I really have not. It makes keeping track of things a lot hard. I did not notice the timestamp change till I was looking for the differences between my working directory and the orignal. I could not tell which was which when the timestamps changed. It is making my development a lot harder.
Until this gets solved, use the script below: (put it in ~/bin, chmod it to 755, and set your PATH to make sure ~/bin preceeds /bin). To use the regular mv, type the path /bin/mv. #!/bin/bash ################################################################## # # mv move targets and preserve owner, mode, and timestamps # # usage: mv src [src1 ...] dest # # date Name Action # ----------- ----------------- ------------------------ # 25 Mar 2008 ARK Origination # ################################################################## DEBUG=1 # 0 = on, non-zero = off CP=/bin/cp CPFLAGS="-p -R" STDERR=/proc/self/fd/2 ARGCOUNT=$# if [ $ARGCOUNT -lt 2 ] then PID=$$ echo ${0}: usage: ${0} src [src1 ... ] dest > $STDERR exit 1 fi # DEST=$!$ARGCOUNT # doesn't work DEST=$BASH_ARGV # DEST=${[$ARGCOUNT]} doesn't get last param if [[ $DEBUG -eq 0 ]] ; then echo $DEST > $STDERR ; fi while [ $ARGCOUNT -gt 1 ] do ## execute the rm ONLY if the copy succeeds without error ${CP} ${CPFLAGS} $1 ${DEST} && rm -rf $1 shift # advance to next arg (( ARGCOUNT -= 1 )) # echo $ARGCOUNT > $STDERR done
-- Boyd Gerber
ZENEZ 1042 East Fort Union #135, Midvale Utah 84047
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2008-03-25 at 13:28 -0600, Boyd Lynn Gerber wrote:
I used the timestamp as a method of telling when the files within were created. This makes it really hard to tell what really is in the directory. I have source code from 1996. When the timestamp changes it makes me think I have changed something in the directory. I really have not. It makes keeping track of things a lot hard. I did not notice the timestamp change till I was looking for the differences between my working directory and the orignal. I could not tell which was which when the timestamps changed. It is making my development a lot harder.
Have you considered using an actual tool to do this for you? Something like svn or cvs, which can tell you when things were changed and what was changed at the click of a button, without the need for any manual searching It seems you are trying to make the file system be a database for you, which was not what it was designed for. Use tools that were designed for what you want, and you won't have to worry about little effects such as this Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 13:28 -0600, Boyd Lynn Gerber wrote:
I used the timestamp as a method of telling when the files within were created. This makes it really hard to tell what really is in the directory. I have source code from 1996. When the timestamp changes it makes me think I have changed something in the directory. I really have not. It makes keeping track of things a lot hard. I did not notice the timestamp change till I was looking for the differences between my working directory and the orignal. I could not tell which was which when the timestamps changed. It is making my development a lot harder.
Have you considered using an actual tool to do this for you? Something like svn or cvs, which can tell you when things were changed and what was changed at the click of a button, without the need for any manual searching
It seems you are trying to make the file system be a database for you, which was not what it was designed for. Use tools that were designed for what you want, and you won't have to worry about little effects such as this
I a way yes, I use both svn and cvs. Depending on the source tree. The
problem is I know exactly where each build for all the os's I use is. It
is very logical setup. I currently have 300 disks that I have to move in
and out depending on the OS. I want to instead use VMware or Virtual Box
to have 3-6 virtual machines. I support right now 8 distributions of
linux, various releases of them, UNIX and various releases. It is just
really easy to look in /home/zenez/freebsd/4.1/build/ and see the time and
to respond.
--
Boyd Gerber
On Tuesday 25 March 2008 12:15, Per Jessen wrote:
Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
I don't know if that's new, but it seems reasonable for the directory to change timestamp when the contents of the directoy changes.
It depends on what you mean by that. Modifying a file (of any sort, including subdirectories or special files) does _not_ update the containing directory's modification time. Only modifying the directory itself (creating or removing directory entries) should change its modification time. And to be clear, creating and deleting are the _only_ directory operations. Renaming (what "mv" does) is accomplished by making a link to the new name followed by unlinking the original name. Cross-device invocations of mv require extra machinations that it handles transparently (basically, it becomes a copy followed by deletion of the original).
/Per Jessen, Zürich
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randall R Schulz wrote:
On Tuesday 25 March 2008 12:15, Per Jessen wrote:
Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
I don't know if that's new, but it seems reasonable for the directory to change timestamp when the contents of the directoy changes.
It depends on what you mean by that. Modifying a file (of any sort, including subdirectories or special files) does _not_ update the containing directory's modification time.
Correct - I should have expressed myself more clearly. I did mean the contents of the directory, not the contents of the contents.
Only modifying the directory itself (creating or removing directory entries) should change its modification time. And to be clear, creating and deleting are the _only_ directory operations. Renaming (what "mv" does) is accomplished by making a link to the new name followed by unlinking the original name.
That's what I was trying to say. Thanks. /Per Jessen, Zürich -- http://www.spamchek.com/ - your spam is our business. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2008-03-25 at 12:47 -0700, Randall R Schulz wrote:
Only modifying the directory itself (creating or removing directory entries) should change its modification time. And to be clear, creating and deleting are the _only_ directory operations. Renaming (what "mv" does) is accomplished by making a link to the new name followed by unlinking the original name.
I don't think that's true. rename(2) is a syscall all of its own, and as far as I know, it is "atomic" Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 25 March 2008 17:41, Anders Johansson wrote:
On Tue, 2008-03-25 at 12:47 -0700, Randall R Schulz wrote:
Only modifying the directory itself (creating or removing directory entries) should change its modification time. And to be clear, creating and deleting are the _only_ directory operations. Renaming (what "mv" does) is accomplished by making a link to the new name followed by unlinking the original name.
I don't think that's true. rename(2) is a syscall all of its own, and as far as I know, it is "atomic"
Sheer revisionism! True (tm) Unix has no such abominations. Nonetheless, the effect is the same.
Anders
RRS -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory? Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory?
No, nothing changed. Here is what ls -l shows
osr6:/home/zenez/etc # ls -l
total 144
-rw-r--r-- 1 root root 32520 2007-11-03 12:03 SuSEfirewall2
drwxr-xr-x 259 root root 16384 2008-03-23 09:47 etc
drwxr-xr-x 153 root root 12288 2008-03-23 09:47 etc.ecom4
drwxr-xr-x 4 root root 35 2008-03-23 09:47 etc.hold
drwxr-xr-x 2 root root 75 2008-03-23 09:47 etc.sav
drwxr-xr-x 225 root root 16384 2008-03-23 09:47 etc.start
drwxr-xr-x 192 root root 16384 2008-03-23 09:47 etc.suse
Notice only the directory timestamp has changed. also note they all have
the same time. All the files within the directories have there orignal
timestamps. Only the directories have changed.
--
Boyd Gerber
On Tue, 2008-03-25 at 20:12 -0600, Boyd Lynn Gerber wrote:
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory?
No, nothing changed. Here is what ls -l shows
osr6:/home/zenez/etc # ls -l total 144 -rw-r--r-- 1 root root 32520 2007-11-03 12:03 SuSEfirewall2 drwxr-xr-x 259 root root 16384 2008-03-23 09:47 etc drwxr-xr-x 153 root root 12288 2008-03-23 09:47 etc.ecom4 drwxr-xr-x 4 root root 35 2008-03-23 09:47 etc.hold drwxr-xr-x 2 root root 75 2008-03-23 09:47 etc.sav drwxr-xr-x 225 root root 16384 2008-03-23 09:47 etc.start drwxr-xr-x 192 root root 16384 2008-03-23 09:47 etc.suse
Notice only the directory timestamp has changed. also note they all have the same time. All the files within the directories have there orignal timestamps. Only the directories have changed.
Ok, I can reproduce this on xfs, not on ext3, and I think I understand why it is happening. The directories *are* changing. Specifically, the .. dentry is changed to point to the inode of the new parent directory. In your ls output I'm willing to bet that you moved the directory to another partition, which means your directory got a new inode number, which in turn means all .. dentries in all subdirectories had to be updated So to my mind it is correct that the mtime gets updated. I see it more as a problem with ext that it doesn't get updated there Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 20:12 -0600, Boyd Lynn Gerber wrote:
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory?
No, nothing changed. Here is what ls -l shows
osr6:/home/zenez/etc # ls -l total 144 -rw-r--r-- 1 root root 32520 2007-11-03 12:03 SuSEfirewall2 drwxr-xr-x 259 root root 16384 2008-03-23 09:47 etc drwxr-xr-x 153 root root 12288 2008-03-23 09:47 etc.ecom4 drwxr-xr-x 4 root root 35 2008-03-23 09:47 etc.hold drwxr-xr-x 2 root root 75 2008-03-23 09:47 etc.sav drwxr-xr-x 225 root root 16384 2008-03-23 09:47 etc.start drwxr-xr-x 192 root root 16384 2008-03-23 09:47 etc.suse
Notice only the directory timestamp has changed. also note they all have the same time. All the files within the directories have there orignal timestamps. Only the directories have changed.
Ok, I can reproduce this on xfs, not on ext3, and I think I understand why it is happening.
The directories *are* changing. Specifically, the .. dentry is changed to point to the inode of the new parent directory. In your ls output I'm willing to bet that you moved the directory to another partition, which means your directory got a new inode number, which in turn means all .. dentries in all subdirectories had to be updated
So to my mind it is correct that the mtime gets updated. I see it more as a problem with ext that it doesn't get updated there
They did not change partitions. They were all in /home/zenez/ This
directory was getting to many directories to follow. I did the
following
mkdir etc-new
mv etc etc.* etc-new/
mv etc-new etc
The above was the result.
--
Boyd Gerber
On Tue, 2008-03-25 at 20:26 -0600, Boyd Lynn Gerber wrote:
The directories *are* changing. Specifically, the .. dentry is changed to point to the inode of the new parent directory. In your ls output I'm willing to bet that you moved the directory to another partition, which means your directory got a new inode number, which in turn means all .. dentries in all subdirectories had to be updated
So to my mind it is correct that the mtime gets updated. I see it more as a problem with ext that it doesn't get updated there
They did not change partitions. They were all in /home/zenez/ This directory was getting to many directories to follow. I did the following
mkdir etc-new mv etc etc.* etc-new/ mv etc-new etc
The above was the result.
Ah, ok, I thought you were showing the contents of the moved directory. Well then my theory above still holds. All directories had to have an updated .. dentry, which means they were modified if (new_parent && src_is_directory) { /* * Rewrite the ".." entry to point to the new * directory. */ error = xfs_dir_replace(tp, src_ip, "..", 2, target_dp->i_ino, &first_block, &free_list, spaceres); ASSERT(error != EEXIST); if (error) goto abort_return; xfs_ichgtime(src_ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); is the code in xfs that does it. So if it gets a new .., update MOD (mtime) and CHG (ctime). The corresponding code in ext3 is old_inode->i_ctime = CURRENT_TIME_SEC; so it only changes the ctime. In other words, it is a conscious choice by the xfs programmers, and while it's unfortunate that the file systems behave differently, I still think xfs got it right here, because the directory is modified Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 20:26 -0600, Boyd Lynn Gerber wrote:
The directories *are* changing. Specifically, the .. dentry is changed to point to the inode of the new parent directory. In your ls output I'm willing to bet that you moved the directory to another partition, which means your directory got a new inode number, which in turn means all .. dentries in all subdirectories had to be updated
So to my mind it is correct that the mtime gets updated. I see it more as a problem with ext that it doesn't get updated there
They did not change partitions. They were all in /home/zenez/ This directory was getting to many directories to follow. I did the following
mkdir etc-new mv etc etc.* etc-new/ mv etc-new etc
The above was the result.
Ah, ok, I thought you were showing the contents of the moved directory.
Well then my theory above still holds. All directories had to have an updated .. dentry, which means they were modified
if (new_parent && src_is_directory) { /* * Rewrite the ".." entry to point to the new * directory. */ error = xfs_dir_replace(tp, src_ip, "..", 2, target_dp->i_ino, &first_block, &free_list, spaceres); ASSERT(error != EEXIST); if (error) goto abort_return; xfs_ichgtime(src_ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
is the code in xfs that does it. So if it gets a new .., update MOD (mtime) and CHG (ctime). The corresponding code in ext3 is
old_inode->i_ctime = CURRENT_TIME_SEC;
so it only changes the ctime.
In other words, it is a conscious choice by the xfs programmers, and while it's unfortunate that the file systems behave differently, I still think xfs got it right here, because the directory is modified
Thanks, that explains it. I should have used ext3 or reiser. The problem
is I had to reboot a machine with 10.2 and 500 GB drives. ext3 has been
doing it's fsck check for 3 hours. I really can not be without my
machines for many hours for the over 3 month fsck check. I have gone back
to reiser on most systems. I guess I have been lucky. I have never had a
data loss(Knock on wood) with reiser. I just do not have 2 more 1TB
drives to change the XFS to reiser. The above makes things very clear.
Thanks,
--
Boyd Gerber
On Tue, 2008-03-25 at 20:39 -0600, Boyd Lynn Gerber wrote:
Thanks, that explains it. I should have used ext3 or reiser. The problem is I had to reboot a machine with 10.2 and 500 GB drives. ext3 has been doing it's fsck check for 3 hours. I really can not be without my machines for many hours for the over 3 month fsck check. I have gone back to reiser on most systems. I guess I have been lucky. I have never had a data loss(Knock on wood) with reiser. I just do not have 2 more 1TB drives to change the XFS to reiser. The above makes things very clear.
You're changing file systems just because the mtime gets updated? What are you doing that makes the mtime so important? Maybe you're using it incorrectly, and should be using something else instead? In any case, you can set the mtime to whatever you want using touch -m, so you can have your old timestamps back if you want Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 20:39 -0600, Boyd Lynn Gerber wrote:
Thanks, that explains it. I should have used ext3 or reiser. The problem is I had to reboot a machine with 10.2 and 500 GB drives. ext3 has been doing it's fsck check for 3 hours. I really can not be without my machines for many hours for the over 3 month fsck check. I have gone back to reiser on most systems. I guess I have been lucky. I have never had a data loss(Knock on wood) with reiser. I just do not have 2 more 1TB drives to change the XFS to reiser. The above makes things very clear.
You're changing file systems just because the mtime gets updated?
What are you doing that makes the mtime so important? Maybe you're using it incorrectly, and should be using something else instead?
I use it to record/keep a record of work done and what needs to be done. It is a personal preference. These disks are/were going to hold my work since 1984. I often do a ls -la on them. Having the time change from 1988 to 2008 really messes things up. I can not easily see what has been done. For example I client calls and want to know the last time I updated package XYZ. I quickly do a ls -la on the location and I can tell him. It was for example Jan 14 2001.
In any case, you can set the mtime to whatever you want using touch -m, so you can have your old timestamps back if you want
Yes, but to do this for 10,000 directories is a real pain.
--
Boyd Gerber
On Tue, 2008-03-25 at 20:54 -0600, Boyd Lynn Gerber wrote:
I use it to record/keep a record of work done and what needs to be done. It is a personal preference. These disks are/were going to hold my work since 1984. I often do a ls -la on them. Having the time change from 1988 to 2008 really messes things up. I can not easily see what has been done. For example I client calls and want to know the last time I updated package XYZ. I quickly do a ls -la on the location and I can tell him. It was for example Jan 14 2001.
Isn't the obvious follow-up from the customer: ...and what did you change then? Using your method you would have to go through the time stamps on all files and look for the latest changes, and even then you might only be able to tell him which file was changed With svn or cvs you ẃould have the answer immediately, without having to do anything extra I think you're optimizing for the wrong problem. But couldn't you at least maintain a changelog file? Files don't change their mtime, and you would also know immediately at least a brief description of what was changed Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 20:54 -0600, Boyd Lynn Gerber wrote:
I use it to record/keep a record of work done and what needs to be done. It is a personal preference. These disks are/were going to hold my work since 1984. I often do a ls -la on them. Having the time change from 1988 to 2008 really messes things up. I can not easily see what has been done. For example I client calls and want to know the last time I updated package XYZ. I quickly do a ls -la on the location and I can tell him. It was for example Jan 14 2001.
Isn't the obvious follow-up from the customer: ...and what did you change then? Using your method you would have to go through the time stamps on all files and look for the latest changes, and even then you might only be able to tell him which file was changed
No, but there is a change log in the directory should I need it. I know from my ls -la that the timestamp on the top level shows me the last time I worked on the application. When it is OSS I feed the changes back up. So the quick look gives me all I need. But when more information is needed then I run the apporiate utilities with svn or cvs.
With svn or cvs you ẃould have the answer immediately, without having to do anything extra
Extra step. What I need is a quick cursory date/time. When more is need you are correct, it is far easier to use the tools.
I think you're optimizing for the wrong problem.
Maybe, but I have been doing it this way since 1972-3. It is hard for an old dog like me to change.
But couldn't you at least maintain a changelog file? Files don't change their mtime, and you would also know immediately at least a brief description of what was changed
I do, so when I need that information it is there. It just is a lot
easier to do an ls -la, then to run the tools. I have to either login to
my build account or run the tools. Sometimes I have to look up the
commands I want. It all takes more time than the ls -la. I hate to have
to stop what I am doing, ssh in using the build account, then run the
tools. Far easier to just do an ls -la on the directory. All I need is a
quick cursory date/time. I do not need the detail. When I need the
detail it is easier to login.
I guess it is old habits, almost forty years of doing things this way.
--
Boyd Gerber
Anders Johansson wrote:
On Tue, 2008-03-25 at 20:39 -0600, Boyd Lynn Gerber wrote:
Thanks, that explains it. I should have used ext3 or reiser. The problem is I had to reboot a machine with 10.2 and 500 GB drives. ext3 has been doing it's fsck check for 3 hours. I really can not be without my machines for many hours for the over 3 month fsck check. I have gone back to reiser on most systems. I guess I have been lucky. I have never had a data loss(Knock on wood) with reiser. I just do not have 2 more 1TB drives to change the XFS to reiser. The above makes things very clear.
You're changing file systems just because the mtime gets updated?
What are you doing that makes the mtime so important? Maybe you're using it incorrectly, and should be using something else instead?
He's using mtime in a reasonable manner. But XFS is providing an "unreasonable" behavior -- and I'm an advocate of using XFS. In light of this, I'm not so sure if I will be quite so pro-XFS now. changing the timestamp on . just because .. has changed is... very shortsighted, and I would consider it a bug.
In any case, you can set the mtime to whatever you want using touch -m, so you can have your old timestamps back if you want
That's a hassle.
Anders
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Tue, 2008-03-25 at 20:26 -0600, Boyd Lynn Gerber wrote:
The directories *are* changing. Specifically, the .. dentry is changed to point to the inode of the new parent directory. In your ls output I'm willing to bet that you moved the directory to another partition, which means your directory got a new inode number, which in turn means all .. dentries in all subdirectories had to be updated
So to my mind it is correct that the mtime gets updated. I see it more as a problem with ext that it doesn't get updated there They did not change partitions. They were all in /home/zenez/ This directory was getting to many directories to follow. I did the following
mkdir etc-new mv etc etc.* etc-new/ mv etc-new etc
The above was the result.
Ah, ok, I thought you were showing the contents of the moved directory.
Well then my theory above still holds. All directories had to have an updated .. dentry, which means they were modified
if (new_parent && src_is_directory) { /* * Rewrite the ".." entry to point to the new * directory. */ error = xfs_dir_replace(tp, src_ip, "..", 2, target_dp->i_ino, &first_block, &free_list, spaceres); ASSERT(error != EEXIST); if (error) goto abort_return; xfs_ichgtime(src_ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
is the code in xfs that does it. So if it gets a new .., update MOD (mtime) and CHG (ctime). The corresponding code in ext3 is
old_inode->i_ctime = CURRENT_TIME_SEC;
so it only changes the ctime.
In other words, it is a conscious choice by the xfs programmers, and while it's unfortunate that the file systems behave differently, I still think xfs got it right here, because the directory is modified
Probably breaking a lot of scripts in the process, merely because .. has an inconsequential change. In theory correct, but in practice, wrong. Not smart! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 25 Mar 2008, Boyd Lynn Gerber wrote:
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 20:12 -0600, Boyd Lynn Gerber wrote:
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory?
No, nothing changed. Here is what ls -l shows
osr6:/home/zenez/etc # ls -l total 144 -rw-r--r-- 1 root root 32520 2007-11-03 12:03 SuSEfirewall2 drwxr-xr-x 259 root root 16384 2008-03-23 09:47 etc drwxr-xr-x 153 root root 12288 2008-03-23 09:47 etc.ecom4 drwxr-xr-x 4 root root 35 2008-03-23 09:47 etc.hold drwxr-xr-x 2 root root 75 2008-03-23 09:47 etc.sav drwxr-xr-x 225 root root 16384 2008-03-23 09:47 etc.start drwxr-xr-x 192 root root 16384 2008-03-23 09:47 etc.suse
Notice only the directory timestamp has changed. also note they all have the same time. All the files within the directories have there orignal timestamps. Only the directories have changed.
Ok, I can reproduce this on xfs, not on ext3, and I think I understand why it is happening.
The directories *are* changing. Specifically, the .. dentry is changed to point to the inode of the new parent directory. In your ls output I'm willing to bet that you moved the directory to another partition, which means your directory got a new inode number, which in turn means all .. dentries in all subdirectories had to be updated
So to my mind it is correct that the mtime gets updated. I see it more as a problem with ext that it doesn't get updated there
They did not change partitions. They were all in /home/zenez/ This directory was getting to many directories to follow. I did the following
mkdir etc-new mv etc etc.* etc-new/ mv etc-new etc
The above was the result.
I do not see the problem on reiserfs. How do I get xfs to not do this? I
do not see it all the time on ext3. I have been fusing with it all day.
XFS always does it. EXT3 seems to do it randomly. REISERFS never. EXT3
to XFS does, EXT3 to REISERFS does not(at least in todays tests). I am
currently doing a 58 GB cpio from my ext3 to XFS and it has been running
now for 6 hours. I will do some more testing once it finishes.
--
Boyd Gerber
On Tue, 25 Mar 2008, Boyd Lynn Gerber wrote:
On Wed, 26 Mar 2008, Anders Johansson wrote:
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory?
No, nothing changed. Here is what ls -l shows
osr6:/home/zenez/etc # ls -l total 144 -rw-r--r-- 1 root root 32520 2007-11-03 12:03 SuSEfirewall2 drwxr-xr-x 259 root root 16384 2008-03-23 09:47 etc drwxr-xr-x 153 root root 12288 2008-03-23 09:47 etc.ecom4 drwxr-xr-x 4 root root 35 2008-03-23 09:47 etc.hold drwxr-xr-x 2 root root 75 2008-03-23 09:47 etc.sav drwxr-xr-x 225 root root 16384 2008-03-23 09:47 etc.start drwxr-xr-x 192 root root 16384 2008-03-23 09:47 etc.suse
Notice only the directory timestamp has changed. also note they all have the same time. All the files within the directories have there orignal timestamps. Only the directories have changed.
etc should have the 22mar08
etc.ecom4 should have the week 10.2 was released
etc.hold should have the week that 10.3 was released
etc.sav should have 18mar08
etc.start should have 14mar08 and etc.suse should hav 12Feb06
--
Boyd Gerber
Anders Johansson wrote:
On Tue, 2008-03-25 at 13:09 -0600, Boyd Lynn Gerber wrote:
Both, but I am mainly using the xfs. I have a lot of small files. The files themselves keep their times, but the directories all change.
ls -l shows you the mtime of a file or directory, i.e. the time it was modified. Did something change inside the directory?
the directory link .. will always change.
Anders
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (7)
-
Anders Johansson
-
Boyd Lynn Gerber
-
Jan Ritzerfeld
-
Per Jessen
-
Randall R Schulz
-
Sam Clemens
-
Sloan