bittles
Posts: 6
Joined: Tue Nov 12, 2013 12:07 pm

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

Tue Nov 12, 2013 12:21 pm

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

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Tue Nov 12, 2013 5:20 pm

What OS are you using, Raspbian?

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

bittles
Posts: 6
Joined: Tue Nov 12, 2013 12:07 pm

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

Tue Nov 12, 2013 5:53 pm

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

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Tue Nov 12, 2013 6:31 pm

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.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Tue Nov 12, 2013 6:50 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

bittles
Posts: 6
Joined: Tue Nov 12, 2013 12:07 pm

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

Wed Nov 13, 2013 1:34 pm

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.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Wed Nov 13, 2013 1:42 pm

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.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

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

Wed Nov 13, 2013 1:44 pm

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.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

bittles
Posts: 6
Joined: Tue Nov 12, 2013 12:07 pm

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

Wed Nov 13, 2013 3:31 pm

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

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Wed Nov 13, 2013 4:20 pm

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).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Wed Nov 13, 2013 4:52 pm

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.

bittles
Posts: 6
Joined: Tue Nov 12, 2013 12:07 pm

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

Wed Nov 13, 2013 5:05 pm

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

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Wed Nov 13, 2013 5:43 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Wed Nov 13, 2013 5:56 pm

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.

bittles
Posts: 6
Joined: Tue Nov 12, 2013 12:07 pm

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

Thu Nov 14, 2013 2:13 pm

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

fisamo
Posts: 2
Joined: Sun Nov 17, 2013 4:24 pm

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

Sun Nov 17, 2013 4:41 pm

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!

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

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

Sun Nov 17, 2013 9:39 pm

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.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

fisamo
Posts: 2
Joined: Sun Nov 17, 2013 4:24 pm

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

Thu Nov 21, 2013 2:33 am

Lol--now that I understand the reason for the advice, the path forward is quite obvious. Thanks for the link. Problem solved.

Return to “Troubleshooting”