LinuxQuestions.org
Visit Jeremy's Blog.
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 04-30-2009, 02:21 AM   #16
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130

It changes ownership of the filex directory recursively.

If you enter this into your terminal:
ls -al /media/backupdrive/filex
you should get a line of information about filex; most likely you will get something like this:
Quote:
drwxr-xr-x 4 root root 58 2009-04-15 00:05 filex
The d means "this is a directory"; a "-" would mean "this is a regular file.
The drwxr-xr-x represents the permissions and splits into three triplets:
- owner can read(r), write (w) and execute(x)
- group members can only read(r) and execute(x), writing is illegal(-)
- other users can only read(r) and execute(x), writing is illegal (-)
The "4" is not relevant to our purpose.
The next piece of information, "root", indicates the owner of this directory: root
The next one, "root" again, indicates the group: also root
The rest is not relevant.
Now, as a regular user, you will not be able to write to this directory because, as pointed out, only root has "rwx" permissions. To solve this, you can change the owner and group using the command I already posted:
chown: change ownership
-R: recursively, i.e. apply to this directory and all of its contents
$USER: change owner to $USER (this variable refers to the user who is running this command, i.e. you)
$USER: change group to $USER
Then, if you run ls -al again, "root root" should have been replaced by "username username".
 
Old 04-30-2009, 03:59 AM   #17
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
jay73:

Thank you for the informative and helpful reply. I will try that.
 
Old 04-30-2009, 11:52 PM   #18
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
jay73, Thanks much, your idea worked perfectly! What I did was to enter

Code:
sudo chown -R $USER:USER /media/backdrive/
And this made every file in the drive writable, deleteable, etc.

Now, for the last question on this topic (I think)...I still have to copy a file to /media/backdrive/ using the console...cannot merely cut and paste. Is there a way to do that?

I want permissions to the drive not just files already on it.

It would just save the extra step of the chown command each time

Thanks again!
 
Old 05-01-2009, 12:57 AM   #19
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
Originally Posted by joseph2020 View Post
jdkaye:

Thank you for your response, heres a copy of the Permissions tab





I am the person who installed Ubuntu and the only user, also the person who made this file (it's a .tar file)... but I am not the owner?? huh?

thanks again
That's correct, Joseph. You are not the owner. "root" is the owner. Jay has given you the command to change ownership (chown). Running sudo (or su) gives you temporary root privileges and so you can change permissions on files/folders owned by root. You cannot do this when using your normal user privileges. This is the whole point of permissions.
cheers,
jdk
 
Old 05-04-2009, 09:18 AM   #20
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Quote:
I want permissions to the drive not just files already on it.

It would just save the extra step of the chown command each time
No, the chown thing is a one time command, it should stick once it has been applied. So I wonder why you still appear to be having permission issues. Maybe you could post the output of ls -Dal /media/backdrive?
 
Old 05-04-2009, 05:00 PM   #21
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
jay73:

Thank you for your response. Here's the output
Code:
joe@joe-desktop:~$ sudo ls -Dal /media/backdrive
[sudo] password for joe: 
  total 28
  drwxr-xr-x 4 joe  joe   4096 2009-05-03 09:46 .
  drwxr-xr-x 5 root root  4096 2009-05-04 04:45 ..
  drwxr-x--- 2 joe  joe   4096 2009-05-03 09:46 2009-05-02joe-desktop.ful
  drwx------ 2 joe  joe  16384 2009-04-28 00:25 lost+found
//DIRED// 59 60 109 111 160 185 234 244
//DIRED-OPTIONS// --quoting-style=literal
joe@joe-desktop:~$
I am thinking I should

Code:
sudo chown -R $USER:$USER /media/backdrive/..
would that fix the problem so I have permissions on the drive not the files. The problem is that the file changes everytime, as it gets overwritten by the newer backup.

Thanks again
 
Old 05-05-2009, 12:10 AM   #22
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
Originally Posted by joseph2020 View Post
Jay73:

thanks for reply.

I need to know what that code does before I can type it in, especially using "sudo"

Code:
sudo chown -R $USER:$USER /media/backdrive/filex
Please explain step by step what this does. Thanks again.
That changes the ownership of the file /media/backdrive/filex from what it was (root in this guess) to $USER (presumably you). chown = "change owner" (get it?)
jdk
 
Old 05-05-2009, 12:30 AM   #23
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
jdkaye: Yes, I get it.

jay73 already explained this to me step by step, which is what I requested. If you wish , you can scroll back and see his reply, which was very detailed and helpful.
 
Old 05-05-2009, 12:54 PM   #24
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
I am wondering what your /etc/fstab looks like. The only explanation I can think of is a mount option that withdraws your permissions after a reboot.
 
Old 05-05-2009, 04:29 PM   #25
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
jay73, thanks for your reply and continuing help.

my fstab:

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=7fbaa41e-4a01-4e9f-b1ea-52ba308beda4 /               ext3    relatime,errors=remount-ro 0       1
# /dev/sda5
UUID=a497b290-d628-444d-b12f-2a1e99c97c4f none            swap    sw              0       0
#------------------------------------------------------------
/dev/scd0  /media/cdrom0  auto   user,noauto,owner,ro  0   0
/dev/sdb1  /media/backdrive  ext2  defaults    0  0
/dev/fd0  /media/floppy       auto  user,exec,rw,noauto    0	0
I found one posting that actually put the floppy icon under "places" at bootup, but clicking on the icon did nothing. this involved adding the word "floppy" to /etc/modules, which I have removed since then because it did not work.

Thanks again
 
Old 05-05-2009, 07:18 PM   #26
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Replace the "defaults" option with:

[QUOTE] noatime,nodiratime,noauto,user,exec,dev,suid [\QUOTE]

If you want the partition to be mounted automatically at boot time, replace "noauto" with "auto".
Then unmount the backup partition and run mount -a.

Edit: on the subject of the floppy; there are a million options you can tweak if you right-click on "Applications", select "edit menus" and check the "Configuration editor" box. The config editor then appears in the menu, under "System Tools"; it is its "apps" branch that has most of the interesting settings.

Last edited by jay73; 05-05-2009 at 07:29 PM.
 
Old 05-05-2009, 11:54 PM   #27
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
jay73, thank you for your reply.

Please remember I need to know what everything does so I can learn from the experience.
Quote:
noatime,nodiratime,noauto,user,exec,dev,suid
Can you please explain what this does?

Quote:
If you want the partition to be mounted automatically at boot time, replace "noauto" with "auto".
I do want the floppy to be mounted at boot time, and I did replace "noauto" with "auto", that make s sense.

Quote:
Then unmount the backup partition and run mount -a.
You lost me. The backup partition is :
Code:
/dev/sdb1  /media/backdrive  ext2  defaults    0  0
how does unmounting that drive affect the floppy drive?

I unmkounted the floppy and then ran mount -a :

Code:
joe@joe-desktop:~$ sudo mount -a
mount: /dev/fd0 is not a valid block device
joe@joe-desktop:~$
I am really lost at this point. Please keep it ultra simple so I can understand. If you could explain these commands it would help me much. I can learn just about anything if its given to me in small digestible portions.

I am going to reboot and see if the new line in fstab mounts the floppy at boot.

Thanks again.
 
Old 05-06-2009, 12:18 AM   #28
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
rebooted with new fstab:

Code:
/dev/scd0  /media/cdrom0  auto   user,noauto,owner,ro  0   0
/dev/sdb1  /media/backdrive  ext2  defaults    0  0
#/dev/fd0  /media/floppy       auto  user,exec,rw,noauto    0	0 
/dev/fd0   /media/floppy       auto  noatime,nodiratime,auto,user,exec,dev,suid 0  0
no change, still have to use "sudo modprobe floppy" to mount fd0

Any help is appreciated, and thanks again.
 
Old 05-06-2009, 02:07 AM   #29
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
I think I have come up with a simple solution. I wrote a shell script (other) with one line in it :

Code:
sudo modprobe floppy
I put that in /bin, gave myself all permissions and if I type "other" in the console the floppy gets moounted.

Now, if I could just get rid of that pesky password prompt for sudo...

Quote:
is there any way to have the script answer the PW request?
I looked through the man modprobe...I did not see anything on this. But, it's always possible I miised it. and lastly
Quote:
where can I put this command or the script to make it start at bootup, like autoexec or config.sys in the DOS days?

Any thoughts are appreciated, and thanks again.
 
Old 05-07-2009, 01:34 AM   #30
joseph2020
Member
 
Registered: Mar 2009
Location: USA
Distribution: Ubuntu 12.04
Posts: 235

Original Poster
Rep: Reputation: Disabled
Problem Solved!

jay73

What I did to solve the problem was create a script "scriptname" with the "sudo modprobe floppy" command in it, and put the script in /etc/init.d/

Then I used
Code:
sudo update-rc.d scriptname defaults
and rebooted system.

the floppy now shows up under Places just as I wanted. I hope this helps anyone with the same problem.

Thank you jay73 for your help. Your clear explanations and patience are appreciated.
 
  


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
using dd to copy 512M drive to 1GB drive DavidHB Linux - Hardware 1 12-12-2006 12:34 PM
Easiest way to copy a boot drive to a new hard drive lsgko Linux - Software 3 05-24-2005 10:38 PM
CD-R Drive to CD-RW Drive Direct Copy CooManChu Linux - Hardware 25 01-08-2005 11:55 AM
How to copy ext2fs from failed hard drive to good drive? DogWalker Linux - Hardware 2 08-30-2004 11:52 PM
Cannot Copy Files From Network FAT32/NTFS Drive to My Local Linux Drive michaelh Linux - Networking 3 10-29-2002 11:27 AM


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