LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   /proc/partitions does not exist (https://www.linuxquestions.org/questions/linux-software-2/proc-partitions-does-not-exist-279022/)

Impaler 01-17-2005 05:44 PM

/proc/partitions does not exist
 
Hi,

I have the following problem :

The /proc/partitions file was deleted (somehow, not sure about it) after the installation of a new kernel in the bootloader (lilo). Does anyone know where can I find the information that the /proc/partitions file holds so I can edit it by hand? My system does not boot in the moment (obviously) because the kernel can't mount the root partition of the device, which "does not exist". I tried to edit the file by copping the knoppix output results of the command "cat /proc/partitions" but still the kernel,at boot time, can't find my root partition. Oh! The new knoppix is really nice by the way. I didn't have the chance to use this version before (thank god!)...

Thanks

kilgoretrout 01-17-2005 06:21 PM

Your post doesn't make a lot of sense. All the contents of /proc are recreated every time you boot. If you boot with a knoppix cd and look at the /proc directory of any linux system you have installed on your hard drive you will see it's completely empty. /proc is generated anew everytime you boot, i.e. the directory is entirely virtual - the files don't exist on your hard disk; they're created on the fly by the linux kernel. You undoubtedly made an error compiling your new kernel.

michaelk 01-17-2005 06:23 PM

/proc is a pseudo file system i.e. it only exists in memory and the kernel creates it at boot up. Hopefully you still have the capability to boot the old kernel? Hindsight is always 20-20 but it is a good idea to not delete old kernels until you have verified the new one.

So, something else is amiss. Explain the procedure you used to install the new kernel.

Impaler 01-17-2005 06:53 PM

Thanks for your replies,

Luckily I haven't erased my old kernel which seems to be working fine. I have the problem though with the new kernel.
I followed these steps to compile-install the kernel:

1)Extracted the kernel source (tar)
2)Created a link which targets on a "linux" file
3)make xconfig (I prefer that because the comments provided make it easier)
4)make-kpkg buildpackage -rev <filename>
5)dpkg -i <filename>.deb (I use debian)
6)Input the new image to lilo
7)Updated lilo
8)Rebooted

Can't see something wrong with that. Maybe is something wrong with my new kernels configuration. I'll configure again and post.

Thanks

Impaler 01-20-2005 09:52 AM

Hi,

The problem was the configuration of my new kernel. I had made some errors with the filesystems and the root partition could not be mounted. I fixed the errors, compiled , installed and everything works fine.

Thanks a lot for you help everyone...

Cody_CN 12-10-2008 10:54 PM

I've got a new solution for this question
 
Hi!
First,I'd like to say that I am not good at English.
I've got the same problem yesterday. I used one morning to find out how to fix it.It's hard to open the linuxquestions's website here,if not so,I would like to ask you in linuxquestions.org. Finally I found the solution and successfully boot my machine.
I got the it here:
www[.]goitexpert[.]com/entry.cfm?entry=Fixing-dup2-bad-file-descriptor-error-on-Linux

Then the answer comes:
If you run in to a problem on Linux when after a reboot you get the following error 'dup2: bad file descriptor error' do not be alarmed, your system has not been compromised and your hard drives have not failed. This error is displayed if you or someone (hopefully your coworkers) have accidentally deleted or overwritten a /dev/null file. The instructions below will show you how to easily fix that problem.


Among the errors that you might recieve are the following: "dup2: bad file descriptor" to "/dev/null: Read-only filesystem" to "could not open /proc/partitions some text about UUID and Label". The step-by-step instructions below will help you fix these errors.

Warning: Only use these if you get "dup2: bad file descriptor" and "/dev/null: Read-only filesystem" during bootup, and
"could not open /proc/partitions some text about UUID and Label" when trying to remount a filesystem.

First you must boot into the single user mode. Although if you get the error and you restart the system it will automatically drop you in into the single user mode shell.

Next you need to mount the /proc partition:

$ mount -o ro /proc

Now you must mount the / filesystem in rw mode

$ mount -o remount,rw /

Next you must delete the /dev/null file and replace it with the correct inode.

$ rm -f /dev/null
$ mknod -m 666 /dev/null c 1 3

The last step is to remount / filesystem back to the ro mode, and restart the system

$ mount -o remount,ro /
$ reboot

That should do it. Hopefully these instruction will save your at the time when errors like that happen.


All times are GMT -5. The time now is 12:09 AM.