LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-11-2008, 01:37 PM   #1
laucian
Member
 
Registered: Oct 2005
Distribution: Ubuntu 9.04
Posts: 124
Blog Entries: 2

Rep: Reputation: 15
mounting, unmounting? not really getting it..how to they work


hi everyone,

i have a question about mounting the file systems..
the device sda2 is mounted on the mount point / on my computer..i switched to 1.runlevel and unmounted the filesystem using

Quote:
umount /dev/sda2
i thought i shouldn't be able to reach the file system at this point..why i can the files when "ls" them? is it not unmounted? what happens up there?
 
Old 03-11-2008, 02:01 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
Originally Posted by laucian View Post

hi everyone,

i have a question about mounting the file systems..
the device sda2 is mounted on the mount point / on my computer..i switched to 1.runlevel and unmounted the filesystem using



i thought i shouldn't be able to reach the file system at this point..why i can the files when "ls" them? is it not unmounted? what happens up there?
You can check to see whether /dev/sda2 is really mounted or not by issuing the mount command with no parameters:

mount

This will list what is currently mounted.

--------------------
Steve Stites
 
Old 03-11-2008, 02:26 PM   #3
laucian
Member
 
Registered: Oct 2005
Distribution: Ubuntu 9.04
Posts: 124
Blog Entries: 2

Original Poster
Rep: Reputation: 15
thanks for your reply, i see it is mounted..
although i have used the umount command just before..
what does umount exactly do?
 
Old 03-11-2008, 02:31 PM   #4
Suicidal9090
LQ Newbie
 
Registered: Apr 2007
Location: Hamilton, Ontario
Distribution: BSD 7.0 / BT 3.0
Posts: 28

Rep: Reputation: 15
if you use "umount" is unmounts the drive for access. You will still be able to see the drive is plugged in, but you will be unable to access any files on the drive. Cant really explain it any easyer, you plug the drive into your machine and your computer will see it - but untill you mount it you won't be able to use the drive. Hope that helps!
 
Old 03-11-2008, 03:31 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I like to think of "mounting" a drive (partition) as connecting it to the directory tree. The tree is typically set up on the partition mounted to / (root). Then other partitions can be connected at any node (mountpoint)

In your case, you were trying to unmount (disconnect) the partition mounted to /. This is not a good thing to do from a running system--it in fact may be that the command was ignored. If you did successfully unmount, your system would simply stop working the first time it went looking for a file.

Try some experiments mounting/unmounting to temporary directories created in /mnt or /media.
 
Old 03-11-2008, 04:01 PM   #6
laucian
Member
 
Registered: Oct 2005
Distribution: Ubuntu 9.04
Posts: 124
Blog Entries: 2

Original Poster
Rep: Reputation: 15
i think before running fsck you have switch to 1.run level `init 1` and then unmount the partition that you want to scan..so if i switch to runlevel one and unmount the partition what happens there? i thought i may not see the files as they are not mounted? isn't that right?
 
Old 03-11-2008, 04:25 PM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
Originally Posted by laucian View Post
i think before running fsck you have switch to 1.run level `init 1` and then unmount the partition that you want to scan..so if i switch to runlevel one and unmount the partition what happens there? i thought i may not see the files as they are not mounted? isn't that right?
If you umount your / mount point then you can no longer access the file system. You couldn't run fsck because the kernel couldn't find fsck. So like pixellany says your system is ignoring your command to umount /.

The way to run fsck against your / partition is to boot a live CD and run fsck from the live CD.

-----------------------
Steve Stites
 
Old 03-11-2008, 04:59 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Quote:
The way to run fsck against your / partition is to boot a live CD and run fsck from the live CD.
Or, if you'd rather not bother with a live CD, as root do:
shutdown -rF now
Your computer will reboot and run fsck as it restarts.
 
Old 03-23-2008, 10:48 AM   #9
laucian
Member
 
Registered: Oct 2005
Distribution: Ubuntu 9.04
Posts: 124
Blog Entries: 2

Original Poster
Rep: Reputation: 15
sorry for the late feedback and thanks a lot for the replies.

i have tried to mount/umount another partition on a mount point and i got it. thanks again for the replies.
 
  


Reply


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
Mounting and Unmounting issues kronuskaos Linux - Hardware 14 11-24-2005 04:32 AM
mounting & unmounting? 777JR Slackware 3 02-08-2004 04:26 AM
Mounting and unmounting in Linux... Tommi Linux - Newbie 3 07-05-2003 09:02 PM
Mounting and unmounting in redhat. Tommi Linux - General 3 04-22-2003 08:08 AM
Mounting and unmounting Hidden Dragon Linux - General 20 09-01-2002 08:52 PM

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

All times are GMT -5. The time now is 12:10 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration