LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-04-2009, 02:46 AM   #1
shrb78
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
flash disk chmod for all user


hi
I use redhat server 4 and flash disk for backup(/dev/sdb) . i use "tar cvf /dev/sdb file-name" for take backup . i have no problem as root but the other users can not access to flash disk i should change premission /dev/sdb to 777 but it work until you remove flash , after removing flash and again putting on system the premission for users will be lost . is there any soloution to change chmod of /dev/sdb after connecting to system for all user to read /write ?
thanks
 
Old 04-04-2009, 03:08 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
/dev/sdb is a device node and not a filename. You should use a filename located at the mountpoint for this device.
You will be replacing the filesystem of the flash disk with the contents of a tar archive. Your flash disk won't contain a file system.

If it works at all for root, that is only because of the "everything is a file" philosophy. The "file-name" part of the command you posted is the file being backed up and not the name of the tarball you are creating.

If you are using an external device for backups, look at adding a line in /etc/fstab that uses the UUID or Label of the filesystem instead of the device node. This will make it more portable. Be sure to use the "noauto" option. This will prevent boot failures when the device isn't present, or assigned a different device node.

If the filesystem used is a native linux filesystem, you can use "chmod" on the mounted mountpoint to change the group allowed access. You could also give other read access. Then also use the "users" option. This will allow other users to mount the filesystem without needing to su to root.

For a non-native filesystem, you would need to use both the "gid=" and/or "uid=" options to allow access as well as the "users" option.

Here is an example of an fstab entry from my laptop:
Code:
hpmedia.jesnet:/home/jschiwal/Podcasts  /mnt/hpmedia/podcasts   nfs     defaults,user,_netdev 0 0
This allows me to mount an nfs shared directory without needing to use sudo. It is the "user" option that allows mount to do this. The "mount" command has the suid bit set. This is a rare instance where this is OK because the mount command was written knowing this and uses the "user" or "users" option in the /etc/fstab entry to determine whether it will perform the mount.

Last edited by jschiwal; 04-04-2009 at 03:17 AM.
 
  


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
Root user unable to rm, mv or chmod Zoar Linux - Newbie 3 10-10-2019 03:12 PM
chmod, user access rights webtrix28 Linux - Newbie 2 11-08-2007 06:03 AM
copy a file to the flash disk and extract it from the flash disk indu.a Linux - Kernel 2 11-15-2006 03:22 AM
USB Flash DIsk - Totaly new redhat user real_shock Linux - Networking 1 07-16-2004 06:33 AM
chmod for user write entries illtbagu Linux - General 2 11-12-2003 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:04 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
Open Source Consulting | Domain Registration