Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rebuilding a dev partition file

Status
Not open for further replies.

piked

Programmer
May 7, 2002
14
AU
Ok, problem is my dev/hda5 file was replaced somehow. This file represented a fat32 partition which I'm sharing between windows98 and linux.

I must have stupidly saved something over it, god knows how, but in its place was an ascii file containing a bunch of garbage. (But it was viewable, as opposed to the other hda* files which prompt me for an application to open them in).

So.. question is, how do I rebuild the /dev/hda5 file, short of reinstalling the OS?

(I've moved this from my previous post because the problem is much different)
 
I suggest you get to the commandline, 'su' to root, and locate the 'MAKEDEV' script on your system. Way back when, you'd find it in /dev, but now both my Debian and Mandrake boxen have them in /sbin. Anyway... try this:

# MAKEDEV -n hda5

The '-n' means 'just test it out, dont really do it'. This way if something should go horribly wrong, you will live to tell about it ;-). If it appears to work, then run it without the '-n' and the device file will be recreated. You may run into an error about the file already existing. If it's got data in it that you need, 'mv' the file elsewhere (saving it), or just go for broke and 'rm' it.

Good luck.
 
Thanks for that, worked beautifully.

The MAKEDEV script is in /dev with redhat, btw. :D

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top