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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-06-2008, 01:26 PM
|
#1
|
LQ Newbie
Registered: Dec 2005
Location: Ghent, Belgium
Distribution: Arch Linux & Ubuntu Linux
Posts: 12
Rep:
|
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 07:31 AM.
|
|
|
12-06-2008, 01:59 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,370
|
Quote:
Originally Posted by phar0z
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
|
|
|
12-06-2008, 04:22 PM
|
#3
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,314
|
Use mount with "remount,rw" as options - no umount.
|
|
|
12-06-2008, 04:38 PM
|
#4
|
Member
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342
Rep:
|
syg00, don't you mean
mount /dev/sda1 / -oremount,ro
|
|
|
12-06-2008, 04:45 PM
|
#5
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,314
|
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.
|
|
|
12-06-2008, 04:51 PM
|
#6
|
Member
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342
Rep:
|
Thanks for the clarification syg00. Nice sigline by the way, my own is inspired by yours.
|
|
|
12-07-2008, 03:58 AM
|
#7
|
LQ Newbie
Registered: Dec 2005
Location: Ghent, Belgium
Distribution: Arch Linux & Ubuntu Linux
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by jailbait
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 05:41 AM.
|
|
|
12-07-2008, 01:31 PM
|
#8
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,370
|
Quote:
Originally Posted by phar0z
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
|
|
|
All times are GMT -5. The time now is 08:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|