LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2011, 04:53 AM   #1
bkarthick
Member
 
Registered: Apr 2009
Posts: 56

Rep: Reputation: 0
How to umount "/" file system


Hi,

I want to umount root partition.

below is the o/p for df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 12G 3.2G 7.8G 30% /
tmpfs 506M 0 506M 0% /dev/shm

If i give #umount /dev/sda1 im getting the below error.i can't unmount the file system
umount: /: device is busy
umount: /: device is busy

thanks,
 
Old 06-03-2011, 04:55 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You obviously can't unmount a partition that's in use. What do you want to do to that partition? You could just get a live CD and do whatever it is on the unmounted partition.
 
Old 06-03-2011, 04:57 AM   #3
bkarthick
Member
 
Registered: Apr 2009
Posts: 56

Original Poster
Rep: Reputation: 0
I want to run fsck command.so i need to unmount the filesystem.
 
Old 06-03-2011, 04:58 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You can't use a live CD for this because..?
 
Old 06-03-2011, 04:58 AM   #5
saivnoba
Member
 
Registered: Aug 2010
Distribution: Debian Sid, openSUSE, Gentoo, Slackware64
Posts: 68

Rep: Reputation: 2
karthick,
You get that error because u are executing that command from within root partition. You cannot do that. Why would you want to unmount '/' (root) partition?! If you want to edit/troubleshoot something on your linux partition, use livecd.

(When I started typing it was a zero-reply thread. By the time I hit enter, I'm the 5th. :-P )

fsck is done automatically after certain mounts during boot. But if you want to force fsck you can try (as root user),
Code:
shutdown -rF now
. This should reboot your system and when it boots it will first run fsck.

Last edited by saivnoba; 06-03-2011 at 05:05 AM.
 
Old 06-03-2011, 05:00 AM   #6
bkarthick
Member
 
Registered: Apr 2009
Posts: 56

Original Poster
Rep: Reputation: 0
@saivnoba

correct me if am wrong..
How do i check my file system ?

To use fsck first i need to umount the file system right ?
 
Old 06-03-2011, 05:03 AM   #7
bkarthick
Member
 
Registered: Apr 2009
Posts: 56

Original Poster
Rep: Reputation: 0
Greetings,

And also i'm going to change the filesystem from ext2 to ext3.

for this i need to unmount the partiton.Without unmounting i can't do it.
 
Old 06-03-2011, 05:05 AM   #8
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Again, why can't you use a live CD to do this?
 
Old 06-03-2011, 05:13 AM   #9
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Rep: Reputation: 14
bkarthic,

first close all the running programs, and then execute umount /dev/sda1. Make sure you have a backup of data and also that you selected the correct partition.

Kind Regards.
 
Old 06-03-2011, 05:13 AM   #10
bkarthick
Member
 
Registered: Apr 2009
Posts: 56

Original Poster
Rep: Reputation: 0
Greetings,

All our servers are in Sweeden.And am in India.I can't use Live Cd or shutdown -rF now.Its all production servers.If it goes down,then i will get trashed.

Without live cd tell me how to check the filesystem.
 
Old 06-03-2011, 05:17 AM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Your only option is the mentioned reboot command.
Also, if it is a production server I would recommend not to change the filesystem, unless there is a real good reason for that.
 
Old 06-03-2011, 05:25 AM   #12
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Rep: Reputation: 14
someone please tell me what is a production server ?
 
Old 06-03-2011, 05:26 AM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by NM04 View Post
someone please tell me what is a production server ?
A server that is essential for a company to get their work done.
 
1 members found this post helpful.
Old 06-03-2011, 05:44 AM   #14
Karl Godt
Member
 
Registered: Mar 2010
Location: Kiel , Germany
Distribution: once:SuSE6.2,Debian3.1, aurox9.2+3,Mandrake?,DSL? then:W7st,WVHB, #!8.10.02,PUPPY4.3.1 now:Macpup
Posts: 314

Rep: Reputation: 45
On boot you could :
put in an exit into /etc/rc.d/rc.sysinit to drop out into a shell ro mount -o remount,ro / for a fsck -n /dev/sda1

boot with the kernel parameters " S init=bin/bash "

On a running system :

Create a or several ramdisks with
Code:
mkfs.ext2 /dev/ram[0-9]
and copy needed files from /bin /sbin /lib /etc into it and
use something like
Code:
mkdir /mnt/ram0
mount /dev/ram0 /mnt/ram0
mkdir /mnt/ram0/old_root
mkdir -p /mnt/ram0 /mnt/ram0/bin /mnt/ram0/sbin /mnt/ram0/lib /mnt/ram0/proc /mnt/ram0/etc
cp -a /bin /mnt/ram0
cp -a /sbin /mnt/ram0
cp -a /lib/lib*.so* /mnt/ram0/lib
cp -ar /etc /mnt/ram0
mount -o move /proc /mnt/ram0/proc
chdir /mnt/ram0
pivot_root . old_root
cd /
umount -l old_root
fsck /dev/sda1
mount /dev/sda1 old_root 
cd old_root
pivot_root . /mnt/ram0
umount -l /mnt/ram0
This would work best with a statically compiled busybox includig ash which has got fsck.ext[2-3] and of course statically compiled fsck's for /lib/lib*.so* could become too large .
For a first better understanding try dl puppylinux 5series , which comes with a /sbin/init shellscript that contains this code .
 
Old 06-03-2011, 06:31 AM   #15
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Could this work?
Code:
mount / -o remount,ro
AFAIK fsck needs the partition to be mounted read-only, not unmounted. But I don't know how the network connection is affected from this. (I have only done this localy in runlevel 1).
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I "cat" or "grep" a file to ignore lines starting with "#" ??? callagga Linux - Newbie 7 08-16-2013 06:58 AM
How to increase a file-system capacity from "/home" to "/" danndp Linux - Newbie 3 04-18-2011 08:58 AM
list file system linux supports "please give the command or system call" varun_shrivastava Linux - General 4 01-09-2007 07:28 AM
System hangs on boot - "Mounting root file system" fails with Via VT6410 enabled Eagleorn Linux - Hardware 3 09-21-2006 12:58 PM
"fc5" mount does not recognize "smbfs" file system? bdplays Linux - Networking 6 06-28-2006 11:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:59 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