LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-06-2008, 12:26 PM   #1
phar0z
LQ Newbie
 
Registered: Dec 2005
Location: Ghent, Belgium
Distribution: Arch Linux & Ubuntu Linux
Posts: 12

Rep: Reputation: 0
problems with fsck


I'm trying to execute a fsck (e2fsck) on my system. Though I boot into single-user mode I'm not able to umount my /dev/sda1 root filesystem. Of course I can't run a fsck on my root partition (/dev/sda1 with / as mountpoint) without my root filesystem being unmounted.

When I try (in single-user mode of course) to run umount /dev/sda1 I get "device is busy". After I ran fuser -km /dev/sda1 my system doesn't give any error when I execute umount -l /dev/sda/1. Unfortunately, I don't notice any difference when I execute mount.

When I try to fsck my /dev/sda1 I see a warning that contains:
Quote:
sda1 is mounted.

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
I would like to execute the fsck command on my system without using a live cd.

Last edited by phar0z; 12-07-2008 at 06:31 AM.
 
Old 12-06-2008, 12:59 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,527

Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by phar0z View Post

I'm trying to execute a fsck (e2fsck) on my system. Though I boot into single-user mode I'm not able to umount my /dev/sda1 root filesystem. Of course I can't run a fsck on my root partition (/dev/sda1 with / as mountpoint) without my root filesystem being unmounted.
You can run fsck against a file system mounted in read only mode. When you boot into single user mode the kernel should mount / as read only.

If you cannot get / mounted in read only mode then I suggest that you use a live CD to run fsck.

---------------------
Steve Stites
 
Old 12-06-2008, 03:22 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,269

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Use mount with "remount,rw" as options - no umount.
 
Old 12-06-2008, 03:38 PM   #4
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
syg00, don't you mean

mount /dev/sda1 / -oremount,ro
 
Old 12-06-2008, 03:45 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,269

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Nope - the OP wants to fsck root - needs (should) be rw.
This works fine BTW - been there, done that.

Of course, fsck can trash files whilst doing it's job; that applies equally with root. Problem is (with root) you can wind up with a dead system.
That is the OPs choice - presumably s/he has read my sigline.
 
Old 12-06-2008, 03:51 PM   #6
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Thanks for the clarification syg00. Nice sigline by the way, my own is inspired by yours.
 
Old 12-07-2008, 02:58 AM   #7
phar0z
LQ Newbie
 
Registered: Dec 2005
Location: Ghent, Belgium
Distribution: Arch Linux & Ubuntu Linux
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jailbait View Post
You can run fsck against a file system mounted in read only mode. When you boot into single user mode the kernel should mount / as read only.

If you cannot get / mounted in read only mode then I suggest that you use a live CD to run fsck.

Steve Stites
I mounted / in read only mode. I'll show you a part of my /boot/grub/menu.lst:

Quote:
title Ubuntu 8.04, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=b5879b46-a447-41e2-926c-6c9f6d4f30af ro quiet splash locale=nl_NL
initrd /boot/initrd.img-2.6.24-19-generic
quiet
It seems to me that / doesn't have to be mounted in read only mode in order to execute a fsck.

mount -o remount,ro /
didn't make any difference.

I'm starting to believe it should be mounted as rw, though this sounds very dangerous to me.

I executed touch /forcefsck in /root and after I rebooted I have removed it.

Last edited by phar0z; 12-07-2008 at 04:41 AM.
 
Old 12-07-2008, 12:31 PM   #8
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,527

Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by phar0z View Post


It seems to me that / doesn't have to be mounted in read only mode in order to execute a fsck.
It doesn't. What read only mode does is prevent other programs from updating the file system control blocks at the same time that fsck is updating the control blocks. Such simultaneous updates will scramble the file system.

--------------------
Steve Stites
 
  


Reply

Tags
fsck, help, mode, mount, root, umount


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot Problems with fsck damber Linux - General 3 04-14-2007 08:09 PM
Fsck and DEVFS problems. Nz_Boy_2004 Linux - Distributions 1 11-29-2004 09:41 AM
fsck problems perry Linux - General 4 07-31-2004 11:22 PM
problems when rebooting (fsck used) plisken Linux - General 3 03-23-2003 03:19 PM
FSCK problems maltaweel Linux - General 3 06-19-2002 01:08 PM


All times are GMT -5. The time now is 10:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration