LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-26-2009, 10:47 PM   #1
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
what happens if i?


what happens if it type sudo rm -r /var/* ?
 
Old 10-26-2009, 10:49 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,318

Rep: Reputation: 126Reputation: 126
Try it and see. (Hint: Linux will do exactly what you tell it to do but not always what you think you told it.) Hope you have a backup and a Live CD.
 
Old 10-26-2009, 10:59 PM   #3
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by Quakeboy02 View Post
Try it and see.
i think not.
 
Old 10-27-2009, 02:29 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
Actually, I don't think you can cripple a system by deleting anything in /var, but you may mess it up at least for one session.
 
Old 10-27-2009, 05:07 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by H_TeXMeX_H View Post
Actually, I don't think you can cripple a system by deleting anything in /var, but you may mess it up at least for one session.
It depends on what do you mean by "cripple". More than probably:
  • Your package manager will stop working, completely. Your distro will no longer be a ditro, since it won't be aware of what a package is or what packages are installed. It will be frozen in time forever.
  • A lot of services requiring spooling will stop working. That includes mail server, print servers, etc.
  • If you use your machine as a web server, your web is gone, a nice one there.
  • Programs currently running will get confused. Some of them might malfunction or even crash, mind of /var/run/*
  • Your databases: gone.
  • Your system logs: gone, and the sys logger will probably stop working as well, since most of them require a minimal directory structures under /var/
  • Some others that I haven't though of right now.

That's crippling enough for me. But yeah, there will be some minimal functionality that will permit you to operate to restore your system. I doubt it would be worth your time however, I'd rather backup whatever needs to be backed up and then reinstall.
 
Old 10-27-2009, 05:14 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by smeezekitty View Post
i think not.
You can always do it in an VM or a chroot if you are really interested.
 
Old 10-27-2009, 05:29 AM   #7
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,013

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
It will remove the /var directory. Don't try it on a good system. You'll need to reinstall.
 
Old 10-27-2009, 05:35 AM   #8
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
None

Last edited by asimba; 10-27-2009 at 05:37 AM.
 
Old 10-27-2009, 01:07 PM   #9
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
what if i ust remove /var/logs or /var/log is that ok?
 
Old 10-27-2009, 01:27 PM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by smeezekitty View Post
what if i ust remove /var/logs or /var/log is that ok?
It's probably OK to remove /var/log/*. It would be safer to do it in single user mode. Some programs may not be happy; I think bootlogd wants to find an old log file (can be empty). If you don't want the logs you could use a tempfs file system for /var/log and it would disappear at shutdown.
 
Old 10-27-2009, 01:55 PM   #11
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Some loggers might need some dubdirectories in there. It depends on the logger and on the config. I am not sure if that would stop the syslogger from running or would just cause some warnings at startup.

Some programs might do slightly strange things when the system logger is not working. But it should be nothing major (besides the fact that you lose virtually all the chances to diagnose any possible problem in your system).
 
Old 10-27-2009, 02:04 PM   #12
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
If you do delete /var/log/* you will likely delete logs of packages you have installed ... I wouldn't consider that crippling, but it will affect you.

When I say crippling, I mean that you would need to boot a live CD (as was mentioned in post # 2) and fix everything in order to regain a functional system. Deleting /var may crash some programs and delete some possibly important stuff, but you should still be able boot properly, and your computer will still be usable, plus some likely bugs that will appear as a result.
 
Old 10-27-2009, 02:07 PM   #13
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Why do you want to do this ?
 
Old 10-27-2009, 02:12 PM   #14
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by repo View Post
Why do you want to do this ?
disk space.
 
Old 10-27-2009, 02:18 PM   #15
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,318

Rep: Reputation: 126Reputation: 126
Quote:
Originally Posted by smeezekitty View Post
disk space.
Oh. I thought you were just being funny. You might see if you have any package manager files hanging around that can be cleaned out. In Debian, that would be in /var/cache/apt/archives, I think, but there is an apt command to clear it. I don't know about the other package managers. Other than that, you have to do it the hard way and go looking for it. In gnome, there is a disk usage analyzer that you can run to see graphically where your space is being consumed.

Good luck.
 
  


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



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

All times are GMT -5. The time now is 11:53 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration