LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-21-2007, 03:08 PM   #1
zsolt_tuser
Member
 
Registered: Jul 2004
Distribution: Debian
Posts: 34

Rep: Reputation: 15
Question Remount root filesystem read-only


Hello,

How can I remount the root filesystem read-only? I want to do that because i want to make a filesystem check with fsck.

Thanks!
 
Old 04-21-2007, 03:16 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
see man mount…
Ex:
Code:
# mount -r -o remount /
 
Old 04-21-2007, 03:36 PM   #3
zsolt_tuser
Member
 
Registered: Jul 2004
Distribution: Debian
Posts: 34

Original Poster
Rep: Reputation: 15
I tried that already, but it doesn't work:
Code:
# mount -r -o remount /
mount: / is busy
 
Old 04-21-2007, 04:07 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Did you also try
Code:
# umount -r /
 
Old 04-21-2007, 04:11 PM   #5
zsolt_tuser
Member
 
Registered: Jul 2004
Distribution: Debian
Posts: 34

Original Poster
Rep: Reputation: 15
Yes, I tried this also:
Code:
umount -r /
umount: /: device is busy
umount: /: device is busy
 
Old 04-21-2007, 04:15 PM   #6
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Are you in the middle of a copy or download?
 
Old 04-21-2007, 04:23 PM   #7
zsolt_tuser
Member
 
Registered: Jul 2004
Distribution: Debian
Posts: 34

Original Poster
Rep: Reputation: 15
No, I am not. But however there are for sure files in use because it's the root file system. That's the problem. And i don't know how to force to remount read-only.
 
Old 04-21-2007, 07:14 PM   #8
zsolt_tuser
Member
 
Registered: Jul 2004
Distribution: Debian
Posts: 34

Original Poster
Rep: Reputation: 15
Or is there another method to check the root filesystem without reboot?
 
Old 04-21-2007, 07:45 PM   #9
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by zsolt_tuser
No, I am not. But however there are for sure files in use because it's the root file system. That's the problem. And i don't know how to force to remount read-only.
Personally, I have /var on a separate partition. Perhaps you might stop certain daemons temporarily (syslogd comes to mind).
 
Old 04-21-2007, 08:47 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Try it in single user - init 1 usually, but who knows with Debian.
I'd just force it on the next re-boot.
 
Old 03-10-2010, 10:15 AM   #11
schlabs
Member
 
Registered: Aug 2007
Posts: 36

Rep: Reputation: 4
Hi, i put this only for the record:
I have the same trouble,i cant remount with the "disk busy" letter, but i need to run fsck.reiserfs.
So googling i found this:

Code:
/bin/mount -no remount,ro /dev/sda2
Quote:
Originally Posted by man page of mount
-n Mount without writing in /etc/mtab. This is necessary for
example when /etc is on a read-only file system.
I find this too in http://old.nabble.com/init-1,-root-d...d16786781.html

Code:
man shutdown:

-F     Force fsck on reboot.
or
Code:
touch /forcefsck

Last edited by schlabs; 03-10-2010 at 10:32 AM.
 
Old 04-27-2011, 04:01 PM   #12
mlcurry
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
Stopping service that are accessing the filesystem

You need to make sure that you gracefully shut down any services that are holding open files before remounting. To do so, run:

Code:
fuser -v -m /
You'll find things like portmap, rsyslogd, atd, etc., containing either "f" or "F" in the flags. All of these should be stopped. Many can be stopped with "service some_service_name stop", with a list of service names found in a location like /etc/init.d. A few processes (like rpc.statd, if it's running) will simply need to be killed. Once this is complete, you can use the above commands to remount your file system.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I have: Root has Read-Write, user has read only for the boot filesystem? xmrkite Linux - Software 6 10-16-2008 04:31 AM
root filesystem read-only: can't reboot! paulsm4 Red Hat 3 04-10-2007 01:50 PM
Root filesystem mounting as Read-Only paddyjoy Linux - Newbie 11 03-21-2006 03:32 PM
INIT stops at remount of root in read-write mode cs30109 Linux - Newbie 0 01-29-2005 06:11 PM
Read-only root filesystem at the boot karimson Linux - General 0 03-20-2003 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration