Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-16-2002, 01:41 AM   #1
Registered: Mar 2002
Location: California, USA
Posts: 41

Rep: Reputation: 15
Hope to save unbootable system

I apologise in advance for the lack of detail in this query. I'm at home right now and the problem is at work. Nonetheless, I'm posting this in the hope that the answer will be obvious to someone. If not, I'll be at work this weekend, and I'll try again with better detail, such as the exact wording of error messages.

Anyway, I have a Mandrake 7.1 system with /var on its own partition. That partition became full. I went in and started removing thousands of .gz files using rm. However, it was incredibly tedious because rm couldn't just remove all the files in a directory at once. If I tried to do that, it would return an error saying "too many arguments." So I had to use wildcards to remove smaller groups of files at a time.

I remembered reading that data sent to /dev/null vanishes, so I decided to try using the cp command instead, like so:

cp -R /var/logs/mail/* /dev/null/

Apparently I'm not the world's leading Linux expert. The result was that the files were actually copied into /dev/null and existed there like files in any ordinary directory. I gathered this immediatly, so I cancelled the command, removed the files from /dev/null, and went back to using rm.

After I had wiped out everything in /var (which took a while), I tried to reboot the machine, but many of the steps in the boot up process failed and it came to a halt with a prompt saying "Type cmd-D for normal bootup". But doing so simply caused the prompt to repeat itself. While the machine was struggling to boot up and I was watching errors go by, I noticed several saying "/dev/null is a directory". That's why I think that thing I did earlier might have hosed up the system.

Maybe I destroyed the special nature of /dev/null and the boot process requires it for some reason. On the other hand, maybe I accidentally removed some file or files from /var that are essential for booting up. Is that possible?

I can boot the machine from a rescue disk and mount my partitions. Is there anything I can do from there to get it to boot normally? What if I copied /dev/null from the rescue disc over the one on the hard drive.

Any help would be greatly appreciated.


Old 03-16-2002, 02:58 PM   #2
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707

Rep: Reputation: 30
Your definately on the right track Ethan!
To remove the /dev/null directory, do this(assuming your linux root partition is mounted on /mnt):
"rm -rf /mnt/dev/null"

Tc copy the special device file from your floppy, you probably need the "-a" switch:
"cp -a /dev/null /mnt/dev/null"

Hopefully thats the only problem...

Here is a duplicate thread:

Last edited by zmedico; 04-20-2002 at 02:09 PM.
Old 03-16-2002, 09:20 PM   #3
Registered: Mar 2002
Location: California, USA
Posts: 41

Original Poster
Rep: Reputation: 15

Thanks zmedico. I'll try that on Sunday when I go in to work.

Old 03-17-2002, 05:02 PM   #4
Registered: Mar 2002
Location: California, USA
Posts: 41

Original Poster
Rep: Reputation: 15
/dev/null restored

Copying /dev/null from the emergency boot CD worked. System boots now.


Old 03-20-2002, 05:08 PM   #5
LQ Newbie
Registered: Mar 2002
Location: Southampton County, VA
Distribution: RH 7.1
Posts: 13

Rep: Reputation: 0

Three comments:

1. The syntax of your cp -R command copies multiple files to a directory, which is the correct syntax. However, /dev/null should not be a directory. It is a character device file. How did you create directory /dev/null/ ?

2. The mknod command can help create/recreate special device files. See man mknod. I used mknod to create a bogus device
file called /dev/junk and tried your cp -R of a bunch of files from
/tmp. It failed telling me the last arg was not a directory.

3. I seem to remember that
find . whatever exec rm {}\;
will get around the limitations of line length in the shell.
Been awhile since I ran that (check man find for syntax)
and it wasn't on Linux. We used to have 24x7 apps
in Unix run away and generate hundreds of useless log files
and we used that to get rid of them.


Tom Eischeid


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unbootable Mandriva System Nether Linux - Newbie 8 09-18-2005 06:33 PM
Now that my system is Unbootable........can someone help me! matthewa Linux From Scratch 1 06-06-2005 09:18 PM
system-config-bind -- save error labMonkey Linux - Networking 0 01-26-2005 01:42 PM
Backup system - which directories to save? geodo Linux - Newbie 2 05-27-2004 11:15 PM
Reinstalling Kernel to save system goldennuggets Linux - General 0 04-19-2004 06:59 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:32 AM.

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