2013-10-23 7 views
5

मैं स्टेट उपयोग कर रहा हूँपहुँच समय एक फ़ाइल के बाद परिवर्तन नहीं करता है

[[email protected] labfiles]$ stat nursery 
    File: `nursery' 
    Size: 837   Blocks: 8   IO Block: 4096 regular file 
Device: fd00h/64768d Inode: 139539  Links: 1 
Access: (0644/-rw-r--r--) Uid: ( 500/ juan) Gid: ( 500/ juan) 
Access: 2013-10-22 18:03:20.703888346 -0400 
Modify: 2013-10-21 16:57:07.801165793 -0400 

तो मैं फ़ाइल को संपादित और बिना इसे बंद (वर्तमान तिथि 23 अक्टूबर 2013 है) एक फ़ाइल के acess समय पाने के लिए खोला जाता है कोई संशोधन, और फिर स्टेटस सबमिट करें

[email protected] labfiles]$ vi nursery 
[[email protected] labfiles]$ stat nursery 
    File: `nursery' 
    Size: 837   Blocks: 8   IO Block: 4096 regular file 
Device: fd00h/64768d Inode: 139539  Links: 1 
Access: (0644/-rw-r--r--) Uid: ( 500/ juan) Gid: ( 500/ juan) 
Access: 2013-10-22 18:03:20.703888346 -0400 
Modify: 2013-10-21 16:57:07.801165793 -0400 
Change: 2013-10-21 16:57:07.801165793 -0400 

लेकिन एक्सेस समय नहीं बदला, क्यों?

मैं किसी भी noatime विशेषता

[email protected] labfiles]$ grep noatime /proc/mounts 
[[email protected] labfiles]$ 

नहीं पा सके माउंट आदेश के उत्पादन में

 
[[email protected] labfiles]$ mount 

/dev/mapper/vg_jnlnxsvr02-lv_root on/type ext4 (rw) 

proc on /proc type proc (rw) 

sysfs on /sys type sysfs (rw) 

devpts on /dev/pts type devpts (rw,gid=5,mode=620) 

tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") 


/dev/sda1 on /boot type ext4 (rw) 
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) 

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) 

[[email protected] labfiles]$ 

उत्तर

9

आप mount के उत्पादन में शामिल किया जा सका है? शायद आपकी डिस्क noatime के साथ घुड़सवार है?

संपादित करें (दोबारा): relatime एक बार संशोधन के बाद पढ़ने पर एक बार अपडेट होगा, लेकिन हर बार नहीं। चूंकि लिनक्स 2.6.30 यह मानक विकल्प प्रतीत होता है, इसलिए यदि आप write + read करते हैं तो यह पढ़ने पर अपडेट होगा। लेकिन write + read + read केवल इसे पहले पढ़ने के लिए अपडेट करेगा (और प्रत्येक निम्न संशोधन के बाद)।

यह देखते हुए कि अपने उपयोग समय पहले से ही अपने संशोधन समय की तुलना में नया है, उपयोग समय जब relatime (या बिना atime विकल्प) के साथ घुड़सवार अद्यतन नहीं किया जा होगा यदि आप केवल पढ़ने के लिए।

man mount से

:

noatime 
Do not update inode access times on this filesystem (e.g., for faster access on 
the news spool to speed up news servers). 

relatime 
Update inode access times relative to modify or change time. Access time is 
only updated if the previous access time was earlier than the current modify or 
change time. (Similar to noatime, but doesn't break mutt or other applications 
that need to know if a file has been read since the last time it was modified.) 
Since Linux 2.6.30, the kernel defaults to the behavior provided by this option 
(unless noatime was specified), and the strictatime option is required to 
obtain traditional semantics. In addition, since Linux 2.6.30, the file's last 
access time is always updated if it is more than 1 day old. 

और रिकार्ड के लिए, यदि आप पुराने व्यवहार वापस करना चाहते हैं, strictatime का उपयोग करें।

Allows to explicitly requesting full atime updates. This makes it possible for 
kernel to defaults to relatime or noatime but still allow userspace to override 
it. For more details about the default system mount options see /proc/mounts. 
+0

जुआन @ जे.एन.-LNXSVR-02 labfiles] $ ग्रेप noatime/proc/माउंट [जुआन @ जे.एन.-LNXSVR-02 labfiles] $ यह पर्याप्त है? –

+0

वास्तव में नहीं, क्योंकि 'रीटाइम' (और कोई झंडे) उसी तरह व्यवहार नहीं करेगा –

+0

ठीक है, मुझे मिल गया। माउंट दिखाता है कि विकल्प relatime सक्षम है। तो, उस स्थिति में, एक्सेस समय लिनक्स 2.6.30 के बाद से बेकार आंकड़े हो सकता है, है ना? –

संबंधित मुद्दे