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 |
GOOD DAY
you can do: umount /cheng and i didn't forget the "n": it's really "umount" By. |
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. |
hey
As root do fuser -k /cheng for more info man fuser |
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. |
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. |
Quote:
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. |
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] |
Hi:
What will be happened if i umount /cheng? Quote:
|
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.
|
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. |
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 |
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. |
It's like this:
Code:
#mount /cheng Code:
#ls /cheng Code:
#umount /cheng Code:
#ls /cheng 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 Code:
rm -rf / Code:
rm -rf ./ |
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:
|
All times are GMT -5. The time now is 07:27 AM. |