Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Telling the Age of a System

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
23 posts • Page 1 of 1
Author
Message
Bigun
Advocate
Advocate
User avatar
Posts: 2198
Joined: Sun Sep 21, 2003 3:45 am
Contact:
Contact Bigun
Website

Telling the Age of a System

  • Quote

Post by Bigun » Thu Jan 14, 2010 6:24 pm

Servers should be kept in service approximately 8 years or until it's capabilities are exceeded. I bought a server a number of years ago, and for the life of me, I cannot remember when I purchased the unit. I am still running the same installation of Gentoo when I installed the unit, so there should be someway of getting a very close age of the system.

Thanks as always!
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Top
BonezTheGoon
Bodhisattva
Bodhisattva
User avatar
Posts: 1408
Joined: Fri Jun 14, 2002 9:39 pm
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

  • Quote

Post by BonezTheGoon » Thu Jan 14, 2010 6:42 pm

I don't know, but I tried a few google searches. Best thing I found was specific to RPM's where it lists the install date. If you can remember some config file that you know you haven't replaced you could sort of glean some information that way. For instance I know I haven't updated the /etc/hosts file on one of my Gentoo boxes since its initial build and it does reflect the correct "machine build date." This isn't perfect, and it isn't what I was looking for, but it might at least meet your immediate need.

Good luck!
mcgruff wrote:I can't promise to be civil.
pjp wrote:The greater evil is voting for the "lesser evil."
Top
timeBandit
Bodhisattva
Bodhisattva
User avatar
Posts: 2719
Joined: Fri Dec 31, 2004 1:54 am
Location: here, there or in transit

  • Quote

Post by timeBandit » Thu Jan 14, 2010 6:44 pm

Assuming you have never reformatted your hard drive(s), migrated to new drives/partitions or otherwise altered the original root filesystem, this will pinpoint the date you first built the system:

Code: Select all

bandit@rockchuck ~ $ ls -ld /
drwxr-xr-x 21 root root 1024 2008-02-11 11:53 /
Edit: Strike that, on further thought I realized it is not accurate. This works, for ext2/3 filesystems:

Code: Select all

# dumpe2fs $(df / | awk '/^\//{print $1}') | grep creat
dumpe2fs 1.41.9 (22-Aug-2009)
Filesystem created:       Sun Jun 25 23:29:59 2006
For a JFS root, use jfs_tune -l in place of dumpe2fs. For other FS types, you're on your own. :wink:
Another effective method is to contact the manufacturer, provide the model and serial number and ask them when it was built or sold.
Last edited by timeBandit on Thu Jan 14, 2010 7:10 pm, edited 2 times in total.
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Thu Jan 14, 2010 6:51 pm

Look at the first few hundred lines of your /var/log/emerge.log? (as long as this file contains all the emerges till date)

Also "genlop -l | less" will show you all the emerges in a more readable format.
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Top
BonezTheGoon
Bodhisattva
Bodhisattva
User avatar
Posts: 1408
Joined: Fri Jun 14, 2002 9:39 pm
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

  • Quote

Post by BonezTheGoon » Thu Jan 14, 2010 6:55 pm

Code: Select all

ls -ld /
has the date wrong on my system, and I cannot think what would have modified the date there, but it is newer than the date listed for my /etc/hosts. Just FYI.

I did find this thread of ideas you might consider looking at.
mcgruff wrote:I can't promise to be civil.
pjp wrote:The greater evil is voting for the "lesser evil."
Top
Bigun
Advocate
Advocate
User avatar
Posts: 2198
Joined: Sun Sep 21, 2003 3:45 am
Contact:
Contact Bigun
Website

  • Quote

Post by Bigun » Thu Jan 14, 2010 7:04 pm

Code: Select all

ls -ld /
and

Code: Select all

last
Seem to be close to matching, seems about February of 2007. So I got about 5 years left.

I wasn't worried about manufacturer's date, this was bought used, but I am treating it as new as if I bought it that way. I really couldn't afford a brand new server at the time.
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Top
timeBandit
Bodhisattva
Bodhisattva
User avatar
Posts: 2719
Joined: Fri Dec 31, 2004 1:54 am
Location: here, there or in transit

  • Quote

Post by timeBandit » Thu Jan 14, 2010 7:08 pm

BonezTheGoon wrote:

Code: Select all

ls -ld /
has the date wrong on my system, and I cannot think what would have modified the date there, but it is newer than the date listed for my /etc/hosts. Just FYI.
Right-o, I realized about a minute after I posted that the mtime on the root directory will change when there is any change to its contents. :oops:
I edited my post with a correct command for ext2/3 and JFS filesystems.
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Thu Jan 14, 2010 7:42 pm

ppurka wrote:Look at the first few hundred lines of your /var/log/emerge.log? (as long as this file contains all the emerges till date)

Also "genlop -l | less" will show you all the emerges in a more readable format.
Nope. The first entries in that are for the builds that Catalyst does when making the stages.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Thu Jan 14, 2010 8:12 pm

john_r_graham wrote:
ppurka wrote:Look at the first few hundred lines of your /var/log/emerge.log? (as long as this file contains all the emerges till date)

Also "genlop -l | less" will show you all the emerges in a more readable format.
Nope. The first entries in that are for the builds that Catalyst does when making the stages.

- John
On my newer laptop, this shows the correct date -- the first package being emerged was gentoo-sources. Perhaps you can look down in the list and see when you emerged your kernel sources.

Other methods:
If you don't rotate your logs you could run `head | /var/log/messages`

or

If you keep your old kernels in your /boot, run an `ls -ltr /boot`

Also, on an ext2/3/4 system, if nothing has ever been written to lost+found it should reflect the date the directory was created.
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Thu Jan 14, 2010 8:36 pm

/var/log/emerge.log is easier to read this way:

Code: Select all

awk -F: '{print strftime("%D %X %Z", $1),$2}' /var/log/emerge.log | less
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Thu Jan 14, 2010 8:39 pm

john_r_graham wrote:
ppurka wrote:Look at the first few hundred lines of your /var/log/emerge.log? (as long as this file contains all the emerges till date)

Also "genlop -l | less" will show you all the emerges in a more readable format.
Nope. The first entries in that are for the builds that Catalyst does when making the stages.

- John
That is why i said "the first few hundred lines" :)

It becomes obvious if you look at the genlop output that some of the initial entries are not from a fresh emerge (the merge times seem too close). Secondly, it seems likely that you would be using some stage3 tarball and then the tarball wouldn't be too old either (maybe at most a month off). So even if you look at those initial merges, you won't be off by too much.
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Thu Jan 14, 2010 9:40 pm

On my boxes the emerge logs start with the very first emerge --sync
next is emerge gentoo-sources and so on ...
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Thu Jan 14, 2010 9:48 pm

I re-mke2fs'ed my server's rootfs before when I migrated from single disk to md-RAID5... I also empty my logfiles once in a while.

I ended up having to find another method of finding how old my Gentoo install was. I ended up looking for the oldest file (actually, directory, since most directory creating things tend to not touch the timestamp back to the past) on my computer and using that as the estimate for when I first installed Gentoo on that computer. Course this is still just a heuristic. And that means I'm going to hit 6 years of Gentoo next month. Few more months till 6-years on f.g.o however.
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
Xytovl
Tux's lil' helper
Tux's lil' helper
Posts: 92
Joined: Sun Mar 15, 2009 6:25 pm

  • Quote

Post by Xytovl » Thu Jan 14, 2010 11:09 pm

According to emerge.log my main Gentoo had it's 4th birthday yesterday at 16:20
I have also noticed there was a lot of cruft in /var/tmp/portage that dated of that time.

I think this is the most reliable way of getting the age, I have changed filesystem, recompiled everything and done almost anything stupid I could imagine.
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Fri Jan 15, 2010 12:43 am

i think /boot/boot from an unmount /boot should show it: early create when installing gentoo, never change by anyone as it's (almost?) unused.
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Fri Jan 15, 2010 3:40 pm

There is an even easier way to read the emerge.log file

Code: Select all

qlop -l | less
Top
notageek
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 134
Joined: Thu Jun 05, 2008 6:07 am
Location: India

  • Quote

Post by notageek » Sat Jan 16, 2010 2:55 pm

Code: Select all

last wtmp
I think the limitation of this is, if /var/log/wtmp or /var/log/btmp have been erased/replaced between the first ever boot and now.
"Defeat is a state of mind. No one is ever defeated, until defeat has been accepted as a reality." -- Bruce Lee
Top
durian
Guru
Guru
User avatar
Posts: 312
Joined: Wed Jul 16, 2003 6:38 am
Location: Rörums Holma

  • Quote

Post by durian » Sat Jan 16, 2010 3:43 pm

I always install uprecords which keeps track of:

Code: Select all

...
    up   1335 days, 04:47:4 | since                     Thu Nov  3 18:33:14 2005
  down   199 days, 17:19:46 | since                     Thu Nov  3 18:33:14 2005
Which is when I installed the the gento I am running now, not real hardware age...

Too late for you now, but maybe your next server :)

-peter
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Sat Jan 16, 2010 4:00 pm

mikegpitt wrote:On my newer laptop, this shows the correct date -- the first package being emerged was gentoo-sources. Perhaps you can look down in the list and see when you emerged your kernel sources.
Huh. Looks like recent stage3 tarballs clean that out. On older ones the log of the catalyst build is present. I think the suggestion of the time of the first emerge of gentoo-sources is a good one. Something like

Code: Select all

qlop -l | grep gentoo-sources | head -n1
- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Sat Jan 16, 2010 4:02 pm

durian wrote:I always install uprecords...
Is that in Portage?

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Sat Jan 16, 2010 4:06 pm

... or simply

Code: Select all

qlop -l gentoo-sources | head -n1
:D
Top
durian
Guru
Guru
User avatar
Posts: 312
Joined: Wed Jul 16, 2003 6:38 am
Location: Rörums Holma

  • Quote

Post by durian » Sat Jan 16, 2010 4:30 pm

john_r_graham wrote:
durian wrote:I always install uprecords...
Is that in Portage?
I thought it was, but it appears I was wrong. I must have installed it from source...

-peter
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Sat Jan 16, 2010 9:19 pm

Found it! It's app-misc/uptimed. :wink:

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
Post Reply

23 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic