Page 1 of 1

Pi won't boot up - "mdev used greatest stack depth"

Posted: Tue Nov 12, 2013 12:21 pm
by bittles
Hi

Pi won't start :x

The last line displaying on boot up is "mdev used greatest stack depth : 5524 bytes left"

Any ideas / help will be much appreciated :D

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Tue Nov 12, 2013 5:20 pm
by rpdom
What OS are you using, Raspbian?

Do you get any response when you press enter on your keyboard?

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Tue Nov 12, 2013 5:53 pm
by bittles
Hi

I think the OS is raspbian. I cheated and bought a pi package with the OS already installed!!!

When the pi stops on its boot up, I can enter basic cmd lines but my unix is rusty so I'm struggling to recall how to work my way around to get the info I need to get a solution

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Tue Nov 12, 2013 6:31 pm
by rpdom
So you get a # prompt without having to log in first?

Do you get a message near the top of the screen that says something like "Welcome to Standalone Raspberry Pi"?

If so, you are in "safe mode" aka "recovery mode". Something is making you Pi boot abnormally. Is anything connected to the gpio pins (specifically pin 5 of connector P1)?

Try putting "avoid_safe_mode=1" in your config.txt file.

One way to do that from safe mode is to type

Code: Select all

echo avoid_safe_mode=1 >>/boot/config.txt
sync;sync
and the restart your Pi. (Make sure you type >>, not >, otherwise you will overwrite your current config.txt completely.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Tue Nov 12, 2013 6:50 pm
by DougieLawson
There may be some value in adding

Code: Select all

boot_delay=n # (with n set  to some value 1 or higher)
to /boot/config.txt

Also if we're dropping into a "safe mode" root shell then there's no harm in looking at what filesystems are available (probably /dev/mmcblkp0 & /dev/mmcblkp1) and running a fsck -y on them.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 1:34 pm
by bittles
Hi

I don't get a prompt, the cursor just sits on the next line after the "[ 4.1782691] usb 1-1.3:Serial Number : 1.0] line. This is the last line that gets rendered to the screen on bootup. Yesterday, the bootup was getting one line further which is the line stated in the original post.

From the prompt (which doesn't have a "#" or any other character being present) if I type in 'dir' I get "-/bin/sh: dir: not found" but I then get the "#" prompt at the beginning of the prompt line. So I don't think I'm in safe mode / recovery mode but I can access some of the OS.

If I do an "ls" it takes a long time but it comes back with README.cmd, dev, lib, sbin ..... sys, var so it looks like the structure is there but I'm not sure where to go and what to do. Sorry.

Again, any help / guidance is much appreciated.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 1:42 pm
by rpdom
bittles wrote:Hi

I don't get a prompt, the cursor just sits on the next line after the "[ 4.1782691] usb 1-1.3:Serial Number : 1.0] line. This is the last line that gets rendered to the screen on bootup. Yesterday, the bootup was getting one line further which is the line stated in the original post.

From the prompt (which doesn't have a "#" or any other character being present) if I type in 'dir' I get "-/bin/sh: dir: not found" but I then get the "#" prompt at the beginning of the prompt line. So I don't think I'm in safe mode / recovery mode but I can access some of the OS.
That does sound exactly like what you would experience in safe mode. The original # prompt gets lost in the screen output, but after you type in any command or press Enter you will get a fresh # prompt.

I bet a 'df' command will show only /boot as mounted.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 1:44 pm
by DeeJay
bittles wrote: Again, any help / guidance is much appreciated.
If this is the 'out of the box' behaviour of a package that you bought that supposedly had the Operating System installed then I think you should return it as "Not as described - Not fit for purpose."

The RPi hardware is unlikely to be at fault. [Although a short circuit on the GPIO P1 header would perhaps give the behaviour you are reporting.]

If you want to try to progress this yourself, which might undermine your right to return it, then you will have to do what you wanted to avoid, and that is to download and install a copy of your chosen Operating System onto the SD card yourself.

If you have a decent wired Internet connection available to your RPi, the NOOBS 'lite' (network only) installer is probably the simplest approach.

See the RPi Downloads Page.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 3:31 pm
by bittles
the 'df' command does return with filesystem details and 'Mounted on .... /boot'

If I keep the re-imaging the SD card as my back up plan, is there a simpler work around I can use to get out of safe mode? A previous comment on the forum suggested adding a line or 2 to my 'init' (if I recall correctly) file to prevent it booting in safe / recovery mode. Which editor is recommended from the prompt to edit the file and what are the cmds? It's been too long since I used vi ! :x (much to my shame !)

Thanks for your quick replies on the forum

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 4:20 pm
by DougieLawson
Since you're in a root shell try this:

Code: Select all

fdisk -l /dev/mmcblk0
fsck /dev/mmcblk0p1
fsck /dev/mmcblk0p2
sync;sync;reboot;
The editor for the Vi-challenged is /usr/bin/nano. I don't like it but it will mostly do what you'd mostly like it to do (vi is easier for me).

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 4:52 pm
by rpdom
I don't think nano is available in safe mode, vi is your best bet.

You may be able to mount the real root filesystem somewhere and chroot into it, but I haven't tried that. Fortunately I have other Linux systems which I can plug the card into (this will even work with another Pi, or the same Pi with another SD card) and edit the files from there.

I have a theory that one version of the firmware incorrectly enables safe mode for some Pis (could be linked to serial number, or possibly detecting the wrong version number), but I've not had it happen on any of mine, so can't say for sure.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 5:05 pm
by bittles
Hi

"fdisk -l /dev/mmcblk0" ran with the following msg on the screen

" .... 4 heads 16 cylinders of 64*512 ...... Partition 1 doesn't end on cylinder boundary .... Partition 2 does not end on cylinder boundary .... fstack used greatest stack depth : 5580 bytes left"

I then ran "fsck /dev/mmcblk0p1" which returned with

"fsck (busybox 1.15.3, ......<date & time stamp> ... fsck: fsck.auto : No such file or directory"

:X

I'm pretty sure I typed in the cmd correctly

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 5:43 pm
by DougieLawson
bittles wrote:Hi

"fdisk -l /dev/mmcblk0" ran with the following msg on the screen

" .... 4 heads 16 cylinders of 64*512 ...... Partition 1 doesn't end on cylinder boundary .... Partition 2 does not end on cylinder boundary .... fstack used greatest stack depth : 5580 bytes left"

I then ran "fsck /dev/mmcblk0p1" which returned with

"fsck (busybox 1.15.3, ......<date & time stamp> ... fsck: fsck.auto : No such file or directory"

:X

I'm pretty sure I typed in the cmd correctly
You need to create a new SDCard or re-image the one you're trying to boot from.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Wed Nov 13, 2013 5:56 pm
by rpdom
bittles wrote:Hi

"fdisk -l /dev/mmcblk0" ran with the following msg on the screen

" .... 4 heads 16 cylinders of 64*512 ...... Partition 1 doesn't end on cylinder boundary .... Partition 2 does not end on cylinder boundary .... fstack used greatest stack depth : 5580 bytes left"

I then ran "fsck /dev/mmcblk0p1" which returned with

"fsck (busybox 1.15.3, ......<date & time stamp> ... fsck: fsck.auto : No such file or directory"

:X

I'm pretty sure I typed in the cmd correctly
Try fsck.vfat /dev/mmcblk0p1
and fsck.ext4 /dev/mmcblk0p2

I think fsck tries to work out the fs type using the auto option, but that might not be available, so you'll have to specify the filesystem type.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Thu Nov 14, 2013 2:13 pm
by bittles
Hi

Thank you everyone for all your help. With a mix of the suggestions added to this thread, I now have my sons pi back up and running

THANK YOU

:D :D :D :D :D

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Sun Nov 17, 2013 4:41 pm
by fisamo
rpdom wrote: Do you get a message near the top of the screen that says something like "Welcome to Standalone Raspberry Pi"?

If so, you are in "safe mode" aka "recovery mode". Something is making you Pi boot abnormally. Is anything connected to the gpio pins (specifically pin 5 of connector P1)?
I am also having this issue. I thought i had botched something up in my configs, in part because I didn't realize that I was able to type at that message. (I've been running my Pi remotely and just now connected video to see the OP-referenced messages during boot; started reviewing the forum and found this thread before connecting a keyboard.)

I can confirm that I am using pin 5 of connector P1, and I'm curious as to why this is an important factor? In terms of remediating the problem, do you consider the 'avoid safe mode' fix (which I will try later today) as sufficient and preferred, or do you recommend that I use a different gpio port so that pin 5 is unused?

Do I really want to prevent the Pi from booting in safe mode if that boot behavior is a 'failsafe' mechanism built in to the Pi to allow me access to the system files in case I do something ... unadvisable ... to my boot/configuration files?

While I await your response, I'll likely move ahead with re-assigning my gpio ports; my application will be very easy to update. However, I'm very curious to understand the reason that using that gpio pin is causing such trouble with booting my pi.

Thanks!

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Sun Nov 17, 2013 9:39 pm
by DeeJay
fisamo wrote:I can confirm that I am using pin 5 of connector P1, and I'm curious as to why this is an important factor? [... deletions...] I'm very curious to understand the reason that using that gpio pin is causing such trouble with booting my pi.
See this - http://www.raspberrypi.org/phpBB3/viewt ... 29&t=12007
In terms of remediating the problem, do you consider the 'avoid safe mode' fix (which I will try later today) as sufficient and preferred, or do you recommend that I use a different gpio port so that pin 5 is unused?
I suggest the latter.

Re: Pi won't boot up - "mdev used greatest stack depth"

Posted: Thu Nov 21, 2013 2:33 am
by fisamo
Lol--now that I understand the reason for the advice, the path forward is quite obvious. Thanks for the link. Problem solved.