SunQuest
           BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 9th, 2004, 06:01 PM
OSX OSX is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: On another planet
Posts: 30 OSX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Unhappy Oh dear - big mistake - have deleted /var !

Yes, I know how stupid I have been but have learnt my lesson.

I am running OpenBSD 3.5 and have deleted the majority of /var.

Is there anyway a basic /var setup can be reconstructed or will I have to reinstall?

Any help or advice would be very welcome.

Regards,
David

Reply With Quote
  #2  
Old September 9th, 2004, 06:04 PM
Charalambos's Avatar
Charalambos Charalambos is offline
Who are you looking at..?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: /home/switzerland
Posts: 229 Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 11 m
Reputation Power: 4
Restore it from your backups...

Reply With Quote
  #3  
Old September 9th, 2004, 06:17 PM
Charalambos's Avatar
Charalambos Charalambos is offline
Who are you looking at..?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: /home/switzerland
Posts: 229 Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 11 m
Reputation Power: 4
No, seriously. It is very difficult to restore it without reinstall, since this directory depends very much on your custom installation. And i don't assume you remember its content to restore it perfectly. I don't think you could manage to restore it to the full functionality of your system. Even if you manage to restore a big part, your system will never be to your full satisfaction again, i believe.
Nontheless, you can try. Find some other system which could serve you with the desired files... don't know if that makes any sense.

Reply With Quote
  #4  
Old September 9th, 2004, 06:33 PM
Charalambos's Avatar
Charalambos Charalambos is offline
Who are you looking at..?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: /home/switzerland
Posts: 229 Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 11 m
Reputation Power: 4
One thing you could try is to recover the deleted files (unless you didn't write new stuff onto the disk).
http://home.fnal.gov/~muzaffar/undelete/README.html
http://www.data-recovery-software.n..._Download.shtml

Reply With Quote
  #5  
Old September 9th, 2004, 06:41 PM
Charalambos's Avatar
Charalambos Charalambos is offline
Who are you looking at..?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: /home/switzerland
Posts: 229 Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 11 m
Reputation Power: 4
Best thing would be if you don't boot your installed bsd, since at boot process log files are written to disk and therefore the deleted files would be overwritten and therefore couldn't be restored anymore. And don't do anything any more on your system that could overwrite the undeletable files. Boot from some boot or live linux cd.

Reply With Quote
  #6  
Old September 9th, 2004, 06:51 PM
OSX OSX is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: On another planet
Posts: 30 OSX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thanks all for your quick and helpful responses.

If reinstalling is the best then that's what I'll have to do. It's just hassle I could do without.

I'm running on Sparc64 platform and don't have a CD drive. I've only recently migrated from Linux so there wasn't too much on there. I have a backup of all the important stuff so it's not the end of the world.

There were some nice tweaks I had made but hopefully I can remember them.

Oh well, at least I've learnt my lesson re: "rm -rf" ...



Thanks again.

Reply With Quote
  #7  
Old September 9th, 2004, 07:01 PM
Charalambos's Avatar
Charalambos Charalambos is offline
Who are you looking at..?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: /home/switzerland
Posts: 229 Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level)Charalambos User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 11 m
Reputation Power: 4
I would nonetheless give recovery / undeletion a try. Perhaps it works.

And about the lessons: the lessons you learn are always from things you regret...
Smart *** rules:
- never use root as everyday account
- never use rm -rf without being absolutely sure about what you're doing
- backup your system regularly
- don't be an idiot

Reply With Quote
  #8  
Old September 10th, 2004, 03:54 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 44 m 45 sec
Reputation Power: 9
OSX: welcome in club!
every serious *nix admin did at least 3-times this stupidity
a gratis tip, costs nothing and can save your work:
cd where-you-want
touch ./-dontsaythat
do you see?
now you really can enter: rm -rf *
rm (or better: the shell) will interprete 'rm -rf -dontsaythat *'
as options..... because not allowed, rm will abort
sure, this will also disturb other cmds, but reinstall is more disturbing.
i made the same mistake a couple of times, now it's called
'experiance' and for green adm i use the trick above

Reply With Quote
  #9  
Old September 10th, 2004, 06:38 AM
OSX OSX is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: On another planet
Posts: 30 OSX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thanks again all,

I've now reinstalled. I would like to have tried those data recovery tools but I don't have time at the moment

Anyway, I've decided to take some precautions and have added the following to my .bash_profile

alias rm='rm -i'



Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Oh dear - big mistake - have deleted /var !


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway