LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what happens if i? (https://www.linuxquestions.org/questions/linux-newbie-8/what-happens-if-i-764696/)

smeezekitty 10-26-2009 10:47 PM

what happens if i?
 
what happens if it type sudo rm -r /var/* ?

Quakeboy02 10-26-2009 10:49 PM

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. :)

smeezekitty 10-26-2009 10:59 PM

Quote:

Originally Posted by Quakeboy02 (Post 3733627)
Try it and see.

i think not.

H_TeXMeX_H 10-27-2009 02:29 AM

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.

i92guboj 10-27-2009 05:07 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 3733805)
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.

i92guboj 10-27-2009 05:14 AM

Quote:

Originally Posted by smeezekitty (Post 3733633)
i think not.

You can always do it in an VM or a chroot if you are really interested.

AwesomeMachine 10-27-2009 05:29 AM

It will remove the /var directory. Don't try it on a good system. You'll need to reinstall.

asimba 10-27-2009 05:35 AM

None

smeezekitty 10-27-2009 01:07 PM

what if i ust remove /var/logs or /var/log is that ok?

catkin 10-27-2009 01:27 PM

Quote:

Originally Posted by smeezekitty (Post 3734338)
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.

i92guboj 10-27-2009 01:55 PM

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).

H_TeXMeX_H 10-27-2009 02:04 PM

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.

repo 10-27-2009 02:07 PM

Why do you want to do this ?

smeezekitty 10-27-2009 02:12 PM

Quote:

Originally Posted by repo (Post 3734397)
Why do you want to do this ?

disk space.

Quakeboy02 10-27-2009 02:18 PM

Quote:

Originally Posted by smeezekitty (Post 3734399)
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.


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