LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2012, 03:32 AM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Rep: Reputation: Disabled
How to find out last access time of USB external HDDs.


Hi All,
Is there a software or command for ubuntu12.04 which tells the last access time of USB external HDDs/history of access time of ext HDDs. Because someone has deleted some files from the ext HDDs. So it would be appreciated if anyone could help me in this.
Thanks in advance for your kind help.
 
Old 08-08-2012, 09:52 AM   #2
kenneth_phough
Member
 
Registered: Dec 2005
Location: Birmingham, AL
Distribution: CentOS, REHL, Vine Linux
Posts: 67

Rep: Reputation: 3
Do you mean the last time you plugged the usb HDD in or the last time you wrote to it?

If it is the former, I think you can check your dmesg (but I can't remeber if it is time stamped)

/var/log/dmesgwill will have entries of when you plugged your HDD, also a good place to look for the device name if you are not sure.

If you are looking for the last time you eddited a file then (well there are many ways):

for example...in the last hour:

find /path/to/mount -type f -mmin 60

A google search will give you results for a bunch of ways to do this. It can be mind boggling or overloading to see so many ways but it will help to chug through them.

Ken
 
Old 08-09-2012, 01:31 AM   #3
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Original Poster
Rep: Reputation: Disabled
Thanks kenneth_phough,
I am looking for only the last time(s) that the external HDD was plugged in to PC(Not only to my PC and it may be to any PC), and not only last time but looking for at least 5 last plugged in times.
There is no use of my system log files if the others are connected that HDD in their machine while I don't have access to their PC. Isn't it?
So is there a way to find out at least 5 last plugged in time?
Thanks for your kind help.

Last edited by roopakl; 08-09-2012 at 01:35 AM.
 
Old 08-09-2012, 10:20 AM   #4
kenneth_phough
Member
 
Registered: Dec 2005
Location: Birmingham, AL
Distribution: CentOS, REHL, Vine Linux
Posts: 67

Rep: Reputation: 3
I don't think there is a way to find out if an external hard drive has been plugged into some other computer that you do not have access to read the system logs.

I think the best way would be to keep track of the modified dates for the files on the HDD to see if anyone touched them.
Maybe do:

Quote:
ls -la /path/to/externaldrive > ~/hdd_change_log01
then, after someone else uses your external drive or every day (whichever suits your need), do:

Quote:
ls -la /path/to/externaldrive > ~/hdd_change_log02
diff ~/hdd_change_log01 ~/_change_log02
and see if there are any changes, like modified date and file size.

HTH, Ken
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 2 external HDDs do not always automount the same way porphyry5 Slackware 3 03-10-2012 09:09 PM
Usb native boot: Can't access HDDs mayquel DamnSmallLinux 1 10-03-2008 07:39 PM
Find the access time ZAMO Linux - General 4 01-07-2008 01:26 AM
Time out with external access to IPCOP digitalhen Linux - Security 0 12-06-2005 04:28 AM
permissions and external hdds DJOtaku Linux - Hardware 1 02-04-2005 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration