LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-19-2005, 11:50 PM   #1
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Rep: Reputation: 15
How to umount file system


GOOD DAY ALL:
I want to unmount the file system /cheng in /dev/hda1.What should i do and how to do it?

TQ
cheng
 
Old 03-19-2005, 11:57 PM   #2
marioitalo
LQ Newbie
 
Registered: Oct 2004
Location: Rio de Janeiro - Brasil
Distribution: Suse 9.2 Pro
Posts: 6

Rep: Reputation: 0
GOOD DAY

you can do:

umount /cheng

and i didn't forget the "n": it's really "umount"

By.
 
Old 03-20-2005, 12:06 AM   #3
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
HI

Tq for ur promptly feedback.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
 
Old 03-20-2005, 12:10 AM   #4
idefinehell
LQ Newbie
 
Registered: Feb 2005
Distribution: FC3
Posts: 24

Rep: Reputation: 15
hey

As root do fuser -k /cheng

for more info

man fuser
 
Old 03-20-2005, 12:10 AM   #5
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
HI

Tq for ur promptly feedback.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
 
Old 03-20-2005, 12:23 AM   #6
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
unmount file system

HI
i want umount the file system /cheng in /dev/hda1.I did use umount /cheng command to umount.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
 
Old 03-20-2005, 12:33 AM   #7
marxist1984
LQ Newbie
 
Registered: Sep 2004
Distribution: Gentoo, Freebsd, Slackware, Debian
Posts: 7

Rep: Reputation: 0
Quote:
Tq for ur promptly feedback.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
I think root has total control of the system, so I'm not sure if you can block "superuser" from anything. However, If you want to restrict others from accessing your "/cheng" directory, then you should add other users to your system. Read the man pages for chmod, adduser, addgrp. Restrict groups or user accounts from accessing /cheng by using chmod:

quick chmod lesson:

r-w-x= full access
4+2+1= 7

if you want to remove write access which is w, subtract the 2 and add the rest of the numbers and you have "5"
r - w - x= full access
4+2+1= 7 - 2= 5

This is the number you remove the 2 to get the sum of 5.

So 4 corresponds to r "read", 2 corresponds to w "write, 1 corresponds to x "execute". r-w-x= 7, r-w=5 ,r--=4, ---=0

chmod 755 filename
7 corresponds to the owner of the file, 5 corresponds to the group, 5 corresponds to everyone else.

I hope this helped you.

Last edited by marxist1984; 03-20-2005 at 12:40 AM.
 
Old 03-20-2005, 12:37 AM   #8
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
Yeah..TQ..Will try it.



[QUOTE]Originally posted by marxist1984
I think root has total control of the system, so I'm not sure if you can block "superuser" from anything. However, If you want to restrict others from accessing your "/cheng" directory, then you should add other users to your system. Read the man paged for chmod, adduser, addgrp. Restrict groups or user accounts from accessing /cheng by using chmod:

quick chmod lesson:

r-w-x= full access
4+2+1= 7

if you want to remove write access which in "w" subtract the 2 and add the rest of the numbers and you have "5"
r - w - x= full access
4+2+1= 5
^
This is the number you remove the 2 to get the sum of 5.

So 4 corresponds to r "read", 2 corresponds to w "write, 1 corresponds to x "execute". r-w-x= 7, r-w=5 ,r--=4, ---=0

chmod 755 filename
7 corresponds to the owner of the file, 5 corresponds to the group, 5 corresponds to everyone else.

I hope this helped you.
[/QUO
TE]
 
Old 03-20-2005, 12:39 AM   #9
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
Hi:

What will be happened if i umount /cheng?

Quote:
Originally posted by marioitalo
GOOD DAY

you can do:

umount /cheng

and i didn't forget the "n": it's really "umount"

By.
 
Old 03-20-2005, 12:43 AM   #10
marxist1984
LQ Newbie
 
Registered: Sep 2004
Distribution: Gentoo, Freebsd, Slackware, Debian
Posts: 7

Rep: Reputation: 0
User will not have access to the information that was mounted previous to your unmounting of the drive. Also make sure to cd out of the mount point directory, or else umount will complain that the directory/device is busy.

Last edited by marxist1984; 03-20-2005 at 12:44 AM.
 
Old 03-20-2005, 12:43 AM   #11
winsnomore
Member
 
Registered: May 2004
Location: USA
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315

Rep: Reputation: 31
Well .. it's not clear what you are saying, do you want to mount or unmount?

Etiher way,
first thing - you shouldn't mount/unmount file systems under "/" .. put them under /mnt/cheng .. that's generally advisable .. though there is no technical reason for it .. just to keep the root level directory clean.

The other problem you have is related to what's in your /etc/fstab .. any filesystem described there can be mounted/unmounted by giving out either it's mount point or
the device (or fs name) .. and it can be done by any user if "user" is set in the filed or can be automounted at boot .

do "man mount" and it should show you .. check out the man entry (if it exists) for "fstab" also ..

Second .. in Unix root is like a god, it can do ANYTHING .. and that includes reading anyones files and folder.

Luckily these days a new things is avaiable that "root" can't figure out .. its to use encryption .. 2.6 kernel comes with it .. you have to enable it on the file systems or files.
and each user can do it .. root can still mount/unmount the fs but it can't figure out the data.
 
Old 03-20-2005, 12:46 AM   #12
bitt_u
Member
 
Registered: Mar 2005
Posts: 39

Rep: Reputation: 15
unmount a file system? as far as my knowledge goes u don't unmount a file system, you can unmount a partition or a drive like floppy drive or cdrom drive.
I suppose u don't want /dev/hda1 to be seen when u log in as root . so just say umount /dev/hda1.I suppose you are rebooting the system before loging as root?in that case check your fstab file(/etc/fstab) and under the options coloumn give noauto command. go to the man page for further details.man umount
 
Old 03-20-2005, 12:49 AM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You could also add a group with the same name as your username. Then 'chgrp <groupname> /cheng will make you both the owner and group owner. Then make sure the the 'other' attributes are cleared for the partition: 'chmod o-wrx' .

Doing this another user will not be able to even enter the directory.

If this parition was a FAT32 partition, you could have added the options 'uid=cheng' and 'gid=cheng'. Because the VFAT filetype (FAT32 partitions) is not a unix/linux file system, you need to set the owner and group owner when the partition is being mounted. You would also need to set the default permissions in the mount statement also, with the 'umask=' option. However, I prefer using the 'fmask' and 'dmask' options instead of the 'umask' option.

You might want to read the 'man mount' page. Reading through the 'info coreutils' would be a good idea also.
Try this in the konqueror web browser! Enter in the address bar: info:coreutils
You may find this easier to read through.
 
Old 03-20-2005, 12:55 AM   #14
bornhj
Member
 
Registered: Sep 2004
Location: Canberra, Australia
Distribution: Fedora Core 3, Ubuntu Hoary, Slack 10.1
Posts: 120

Rep: Reputation: 15
It's like this:

Code:
#mount /cheng
Code:
#ls /cheng
file1     file2     file3     file4
#
Code:
#umount /cheng
Code:
#ls /cheng
#
Unmounting the filesystem means that you can't access the files. You mount the filesystem to be able to see the files on the device.

By the way, it sounds like you are using the root account for everyday functions. VERY bad idea. Like marxist1984 said, read the man pages for chmod, adduser, addgrp by doing:
Code:
# man chmod
--or--
# man adduser
--or--
# man addgrp
One typo while working at the command line as root can wipe your whole hard disk i.e.
Code:
rm -rf /
will wipe your hard disk whereas
Code:
rm -rf ./
will wipe your current folder.
 
Old 03-20-2005, 01:25 AM   #15
cheng
LQ Newbie
 
Registered: Aug 2002
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
In my fstab i edit it like this
/dev/hda1 /cheng ext3 noauto 1 2
If the /dev/hda1 is no mounted,what will be happen?
What i want is when the user log in his/her username,then he/she only can access to their home directory,they can not go to other directory.How to do it?



Quote:
Originally posted by bitt_u
unmount a file system? as far as my knowledge goes u don't unmount a file system, you can unmount a partition or a drive like floppy drive or cdrom drive.
I suppose u don't want /dev/hda1 to be seen when u log in as root . so just say umount /dev/hda1.I suppose you are rebooting the system before loging as root?in that case check your fstab file(/etc/fstab) and under the options coloumn give noauto command. go to the man page for further details.man umount
 
  


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
An error Occurred during the file system check. Dropping you to shell; the system wil aneikei Linux - Newbie 3 02-11-2010 07:38 PM
figuring out 'file system' and 'swap file system' types TrulyTessa Linux - Newbie 3 09-26-2005 06:46 PM
Can't unmount NFS. Remote NFS system was down. PeteRossi Linux - Software 3 10-05-2003 02:23 PM
command 'unmount' not found - how can i unmount??? GloVe Linux - General 1 10-04-2003 06:33 AM
File System Forced Unmount snoopy42 Linux - General 1 12-04-2002 10:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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