Sponsored Content
Operating Systems Solaris Zfs - what does atime update? Post 302954571 by jabberwocky on Wednesday 9th of September 2015 04:49:02 AM
Old 09-09-2015
Zfs - what does atime update?

It is widely documented that on zfs atime updates the access time on zfs.
Where is the access time updated on Solaris 11.2?

If I create file atimetest.txt under rpool/export/home:

Code:
# zfs list rpool/export/home
NAME                USED  AVAIL  REFER  MOUNTPOINT
rpool/export/home  13.3G  21.0G  13.3G  /export/home
#

Code:
# ls -lt /export/home/atimetest.txt
-rw-r--r--   1 root     root          15 Sep  9 09:31 /export/home/atimetest.txt
# cat /export/home/atimetest.txt
this is a test
#

The atime is set to on, so I set it to off:
Code:
# zfs get atime rpool/export/home
NAME               PROPERTY  VALUE  SOURCE
rpool/export/home  atime     on     default
# zfs set atime=off rpool/export/home
# zfs get atime rpool/export/home
NAME               PROPERTY  VALUE  SOURCE
rpool/export/home  atime     off    local
#

I then check the time, run ls -ld against the directory, run ls -tl against the file:
Code:
# date
Wednesday,  9 September 2015 09:39:10 BST
# ls -ld /export/home
drwxr-xr-x  11 root     root          12 Sep  9 09:31 /export/home
# ls -lt /export/home/atimetest.txt
-rw-r--r--   1 root     root          15 Sep  9 09:31 /export/home/atimetest.txt
#

Then cat the file from /:
Code:
# pwd
/
# cat /export/home/atimetest.txt
this is a test
#

Checking the directory with ls -ld and checking the file with ls -lt shows no update for the access time:
Code:
# ls -ld /export/home
drwxr-xr-x  11 root     root          12 Sep  9 09:31 /export/home
# ls -lt /export/home/atimetest.txt
-rw-r--r--   1 root     root          15 Sep  9 09:31 /export/home/atimetest.txt
#

So, where is the access time updated?
I can see the setting of atime=off in zpool history:
Code:
2015-09-09.09:36:17 zfs set atime=off rpool/export/home

but no update for access time.
I'd like to set atime=off for zfs on application servers, but would like a before and after image to access the change.
This behaviour is replicated on both solaris 10 and 11 x86.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

atime, ctime, mtime somewhere along csize..

i have used all forms of the unix find command.. and right now this is the only command i can think of that might have this option..: if i use mtime i am looking at a time interval.. but if i wanted to find out intervals of access, change and modification according to when a file changed size... (4 Replies)
Discussion started by: moxxx68
4 Replies

2. Programming

read() without changing atime ?

Hey, First of all I want to know How do I see the atime of a file ?? Whats the command ?? I think ls -l shows the last modified time right ? Because when I use cat to read a file, the timestamp shown by ls -l does not change. Its not ls -lu ! man ls did not help ! How do I see the last... (8 Replies)
Discussion started by: tantric
8 Replies

3. Tips and Tutorials

mtime, ctime, and atime

Unix keeps 3 timestamps for each file: mtime, ctime, and atime. Most people seem to understand atime (access time), it is when the file was last read. There does seem to be some confusion between mtime and ctime though. ctime is the inode change time while mtime is the file modification time. ... (2 Replies)
Discussion started by: Perderabo
2 Replies

4. Shell Programming and Scripting

how to find ot ctime , mtime ,atime

Can any one tell me how to find out ctime , mtime ,atime for a file/directory on unix. Cheers, Nilesh (5 Replies)
Discussion started by: nilesrex
5 Replies

5. UNIX for Advanced & Expert Users

mtime VS atime VS ctime

hi, in trying to maintain your directories, one needs to do some housekeeping like removing old files. the tool "find" comes in handy. but how would you decide which option to use when it comes to, say, deleting files that are older than 5 days? mtime - last modified atime - last accessed... (4 Replies)
Discussion started by: pinoy43v3r
4 Replies

6. UNIX for Dummies Questions & Answers

-atime not working as expected

I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read Testing commands on a local test folder... $ date Wed Sep 28... (10 Replies)
Discussion started by: canon273
10 Replies

7. UNIX for Advanced & Expert Users

Why updating atime doesn't update ctime?

Hi, ctime is the inode change time. If reading a file, its atime will be updated, which should cause inode member i_atime changed, which is an inode change. So ctime should also be updated. But if I try to ls a directory on redhat, only the directory atime gets updated, not ctime. Why? THANKS! (2 Replies)
Discussion started by: password636
2 Replies

8. UNIX for Dummies Questions & Answers

Having a hell of atime with KSH -ftp automation

Following this thread: https://www.unix.com/ip-networking/1935-automated-ftp-task.html I have created the following script: #! /bin/ksh HOST=ftp.mywebsite2.com USER=astrocloud PASSWD=8**** exec 4>&1 ftp -nv >&4 2>&4 |& print -p open $HOST print -p user $USER $PASSWD print -p cd... (3 Replies)
Discussion started by: Astrocloud
3 Replies

9. Solaris

How to update zfs-based flar?

Hello! I have ZFS-based flash archive (flar file). I need to install to it several additional packages and patches. As I know, it is possible for USF-based flar, but how to do it with ZFS-based one? (0 Replies)
Discussion started by: sluge
0 Replies
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy