You are not logged in.

#1 2011-04-19 23:44:38

dauerbaustelle
Member
Registered: 2010-02-07
Posts: 62

boot-time fsck fails "/dev/sda2 is mounted"

I had a kernel crash during the last shutdown which causes a force-fsck on boot-time. Unfortunately that doesn't work because fsck complains about /dev/sda2 already being mounted (/dev/sda2 is my root partition) and asks me to abort the fsck.

How can I get the file system back into a sane state? Already tried `shutdown -f` but that didn't suppress the fsck try.

Thanks!

Offline

#2 2011-04-20 02:27:21

fphillips
Member
From: Austin, TX
Registered: 2009-01-24
Posts: 202

Re: boot-time fsck fails "/dev/sda2 is mounted"

Normally when there is a forced fsck it will give you the option to login and tell you what to run to fix it.

Anyway - at the grub menu, hit e, then highlight the kernel line, hit e again, edit it so that init=/bin/sh, then escape, and b to boot. Then you can run your fsck.

Offline

#3 2011-04-20 03:06:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,768

Re: boot-time fsck fails "/dev/sda2 is mounted"

fphillips wrote:

Anyway - at the grub menu, hit e, then highlight the kernel line, hit e again, edit it so that init=/bin/sh, then escape, and b to boot. Then you can run your fsck.

Cool smile  I like Linux because I learn something new all the time.
At the risk of hijacking the thread, how should one leave this shell?  'exit' generates a kernel panic for trying to kill init.  Should it have been a 'reboot'?

Come to think of it, it really isn't a hijack as it does relate to the answer to the OP.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2011-04-20 04:34:59

fphillips
Member
From: Austin, TX
Registered: 2009-01-24
Posts: 202

Re: boot-time fsck fails "/dev/sda2 is mounted"

I don't know if there's a clean way to exit, but it does demonstrate the importance of physical security. Anyone who has physical access can do this, mount your disks, change your root password, etc. So if you ever forget your root password you can recover it. The other physical threats are allowing booting from CD/USB.

Then _you're_ hijacked. smile

Offline

#5 2011-04-20 08:17:07

pezz
Member
From: Geelong, Australia
Registered: 2010-05-23
Posts: 75

Re: boot-time fsck fails "/dev/sda2 is mounted"

To OP: Curious if you just upgraded 2.6.38.3-1?

I just did, and the part in rc.local that remounts / as read-only failed, therefore I now get a warning about fsck'ing a mounted filesystem...

If so, I believe it's a bug with either the latest kernel or udev (the only two things I've just upgraded).

Offline

#6 2011-04-20 08:50:52

hoobastank
Member
Registered: 2010-03-30
Posts: 87

Re: boot-time fsck fails "/dev/sda2 is mounted"

@pezz
You are right coz I have this problem since updated my kernel and I couldnt figure out yet how can I solve this problem.

Offline

#7 2011-04-20 09:05:47

dauerbaustelle
Member
Registered: 2010-02-07
Posts: 62

Re: boot-time fsck fails "/dev/sda2 is mounted"

fphillips, thanks! pezz: Yep, exactly that.

Offline

#8 2011-04-20 11:56:26

hoobastank
Member
Registered: 2010-03-30
Posts: 87

Re: boot-time fsck fails "/dev/sda2 is mounted"

So what is the permanent solution? wait for next update? This problem has come out today after update. Boot process warns me about maximal mount count reached.

[Ext3-fs] warning: maximal mount count reached, running e2fsck is recommended

after then, mounting root read-only failed.

Mounting Root Read-only [FAIL] /dev/sda2 is mounted
Checking Filesystem 
warning: The filesystem is mounted if you continue you will cause severe filesystem damage
Do you really want to continue (y/n)?

I choose "no" and boot process goes on as expected. Following I didnt see any problem when loading Gnome. Everything is ok on desktop environment but this problem annoys me.

Last edited by hoobastank (2011-04-20 11:59:50)

Offline

#9 2011-04-20 16:26:34

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: boot-time fsck fails "/dev/sda2 is mounted"

Nice to read I did not mess up myself. I had the same problem just now for the first time. I thought it was related to me messing with udisks-glue yesterday.

If I use the init=/bin/sh trick, I also get the message my filesystem is mounted, when trying to run fsck.

Last edited by FreeTheBee (2011-04-20 16:33:09)

Offline

#10 2011-04-20 17:57:25

hoobastank
Member
Registered: 2010-03-30
Posts: 87

Re: boot-time fsck fails "/dev/sda2 is mounted"

I didnt understand anything why mounting root read-only was failed. I tried to downgrade kernel, looked at /etc/fstab, /lib/initcpio/init_function but couldnt realize any error. nevertheless os is still working as expected. It's really annoying.

Offline

#11 2011-04-20 20:21:05

lowie82ph
Member
Registered: 2008-08-10
Posts: 22

Re: boot-time fsck fails "/dev/sda2 is mounted"

I think there is something wrong with the latest version of udev, I downgraded it, then the "mounting root read-only failed" issue is gone.

Offline

#12 2011-04-20 20:46:10

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: boot-time fsck fails "/dev/sda2 is mounted"

Same here. After reading your post I downgraded to udev 166-2 and the problem is gone.

Offline

#13 2011-04-20 21:08:37

hoobastank
Member
Registered: 2010-03-30
Posts: 87

Re: boot-time fsck fails "/dev/sda2 is mounted"

@lowie82ph
Yes, you are absolutely right. Problem is caused bye udev.

Offline

#14 2011-04-21 03:06:26

Enunes
Member
Registered: 2009-08-06
Posts: 11

Re: boot-time fsck fails "/dev/sda2 is mounted"

I guess the last kernel package (2.6.38.3-1) fixes this.

I was getting this error too and after upgrading it stopped, and I maintain udev 167-1.

Offline

#15 2011-04-21 15:35:15

decaturguy
Member
From: Sweden
Registered: 2006-11-28
Posts: 117

Re: boot-time fsck fails "/dev/sda2 is mounted"

Not fixed in kernel26-lts i had to downgrade udev.

Offline

#16 2011-04-22 01:49:04

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: boot-time fsck fails "/dev/sda2 is mounted"

Same problem, it's reported on the tracker @ https://bugs.archlinux.org/task/23845 -  hopefully will be sorted soon.

Last edited by Meyithi (2011-04-22 16:08:14)


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#17 2011-05-25 06:34:54

Flavious
Member
Registered: 2007-11-24
Posts: 49

Re: boot-time fsck fails "/dev/sda2 is mounted"

I have the same problem with kernel26 2.6.38.6-2

Offline

Board footer

Powered by FluxBB