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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't Boot -- Bad File Descriptor 2

Status
Not open for further replies.

zviw

MIS
Oct 11, 2002
34
US
Thanking everyone in advance.

I need to either get this system to start normally (best situation) or somehow manage to recover specific data from one partition.

Dell Poweredge Server running RHL 7.3 ext3; 1 SCSI HD (36GB) -- single boot server (DHCP, SAMBA, SQUID)

Getting filesystem errors on boot -- some scroll off screen too quickly to read.

I'm a technical person but not skilled at command line Linux.

Last errors - (typing in):

Activating swap partitions: dup2: Bad file descriptor [red][FAILED][/red]
Setting hostname Leshkow2: dup2: Bad file descriptor [red][FAILED][/red]
/etc/rc.sysinit: /dev/null: Read-only filesystem
/etc/rc.sysinit: /dev/null: Read-only filesystem
Mounting USB filesystem: dup2: Bad file descriptor [red][FAILED][/red]
Initializing USB controller (usb-ohci): dup2: Bad file descriptor [red][FAILED][/red]

grep: /proc/mounts: No such file or directory
Checking root filesystem
dup2: Bad file descriptor
[red][FAILED][/red]

Then it prompts for password in order to drop to a shell prompt.

I ran fdisk, extended partition (/dev/sda4) had DOS file descriptor. Copied down partition table info, deleted partition, recreated with correct ID, recreated extended partitions (/dev/sda5-7) with info from table.

Ran e2fsck on each partition (no switches - Don't know which, if any, to use) read in each journal - result clean. Except swap partition which e2fsck reports that it doesn't work on (now you know the limits of my knowledge [smile])

Still same problem

Zvi
 
Try running fsck with the -f option.


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Ok - I'll try that as soon as I get back in to the office

I'll let you know how it goes.


Zvi
 
No luck.

Ran fsck -f, it found errors on one partition that I let it correct. Still receiving same errors on boot


Zvi
 
Found Solution [bigsmile]

It took a while on Google, but I found it best described in a posting to Linux-IL. The posting had the following quote from an unnamed source:

Begin quote:

How to fix "dup2: bad file descriptor" on Linux
This error is actually happen because the /dev/null entry in the device inode permission is screwed up when the system is showing:

mounting proc filesystem [ ERROR ]
dup2: bad file descriptor,

Note: The following step will fix the error:

Proceed with login to repair filesystem (provide root password)

Next mount your root filesystem
mount -n -o remount,rw /dev/hdxx (where hdxx or sdxx is your root partition)

Remove the /dev/null entry
rm -rf /dev/null

Since we've already remove the /dev/null, we have to create a new writeable entry

mknod -m 666 /dev/null c 1 3

Reboot the system using shutdown -r now or shutdown -h now, the filesystem should be correctly mounted the next round of booting.

End quote.

Zvi
 
zeland

Thanks for the help. I didn't realize that fsck wouldn't just check the partition.

Zvi
 
If you are in a tight spot like this, I prefer to boot with a Live-CD like KNOPPIX and then mount the partitions manually. This allows me to determine if there are configuration issues BEFORE I start changing things.

Once I know that I can still access your data if I need it, it takes the panic out of the situation.


pansophic
 
pansophic:

I really have to learn my way around Linux. As I wrote in my original post, I'm a technical person, but my Linux knowledge is limited.

I've heard about KNOPPIX before, I really need to learn more basics.

Thanks

Zvi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top