Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
Hallo, I have a slight problem. My PCLinuxOS is great and works perfect, but I can't copy stuff to my USB drive. I can read from it though. I can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    478

    How do I copy to USB?


    Hallo,

    I have a slight problem. My PCLinuxOS is great and works perfect, but I can't copy stuff to my USB drive. I can read from it though. I can copy to it when I'm root, but I don't want to log in as root EVERYTIME I want to copy my files to my USB drive? Also, how can I give access to my user to copy stuff to the hardrive in a directory other than my "HOME" directory.

    I can only copy to the desktop and HOME how do I change this? It's really annoying having to log in as root to do the smallest of tasks.

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Well, to access the USB, you need to mount it writable by non-root users. Can you post up your /etc/fstab?

    Writing to places other than /home and /tmp are intentionally disabled by regular users: these are all system files, and modification can have consequences.

    If you still want to write to them (which I HIGHLY advise against: it can be a big security risk), you can do so by changing permissions with the chmod command. Write permission on a file allows you to write to it. Write permission on a directory allows you to create and delete files within the directory. Executable permission on a directory allows you to enter the directory. Everything else should be self-explanatory.

  3. #3
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    478
    I'll post the fstab tomorrow because I'm not at home at the moment. The reason I want to be able to write to locations other than home is because I want to install software without being root and when I download stuff I don't always want to save them to home.

    For example: it won't be nice having to install let's say for example games, libs etc in the home folder...and having to switch to root to do that each time is not nice either. so basically I only want to be able to write, copy, delete etc to /usr/local/bin and /usr/local/src/ I'm not much concerned about the other directories because I hardly use them.

    Thanks for the help...how do I do the chmod though? I don't even know what exactly it is and what you mean...I'm totally new.

  4. #4
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Well, first off, know that you can install software to any location you want if you do it by source.
    Code:
    ./configure --prefix=/home/user/apps/
    make
    make install
    It will install to /home/user/apps/bin, /home/user/apps/lib, etc.

    Do you know how Unix permissions work? Basically, chmod is the command that lets you change permissions. If you don't know how the Unix permissions work, let me know, and I'll explain it. Run the command "man chmod" to see chmod's manual.

  5. #5
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    478
    I have no idea how it works, but I'll try some stuff at home. At the moment I still don't have an internet connection at home...waiting for ISP...

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    as Cabhan wrote, its not good practice to set write permission for regular users...

    Quote Originally Posted by netstrider
    For example: it won't be nice having to install let's say for example games, libs etc in the home folder...and having to switch to root to do that each time is not nice either.
    for installing packages, gain root privileges using 'su' command. you dont have to login and logout as root all the time.





    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Ah, fun stuff. Well, basically, here is how Unix permissions work:

    Every file and directory has an owner (a single user) and a controlling group. Therefore, every user on the system falls into one of three categories:

    - Owner
    - Controlling Group
    - Others

    Therefore, you can set individual permissions for each group. There are three permissions: readable, writable, and executable. These are represented either with letters (r, w, x) or by numbers (r = 4, w = 2, x = 1). Full permissions for everyone are represented as rwxrwxrwx or 777.

    So let's say you have a file called foo. You want foo to have all permissions for the user 'jack', to be readable and executable by all members of the group 'people', and to only be readable by everyone else.

    First, we need to set the user and group using the chown utility:
    Code:
    chown jack:people foo
    Now we need to set the proper permissions using chmod. So we could do this:
    Code:
    chmod u=rwx foo
    chmod g=rx foo
    chmod o=r foo
    
    OR
    
    chmod 764 foo
    See how that works? chmod has some interesting syntax. First off, because 'owner' and 'others' both start with 'o', we use 'user' instead of 'owner' here. Syntax is as such:
    Code:
    chmod u+x <file>  # Add executable permission for owner, leaving all other permissions untouched
    chmod u-x <file> # Remove executable permission for owner, leaving all other permissions untouched
    chmod ug=rx <file> # Set owner and group to have r-x permissions, leaving the permissions for others as they were
    chmod +x <file> # Add executable permissions for all three groups
    And so on.

    I hope that helps, and feel free to ask more questions.

  8. #8
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    478
    This is all cool...How do I set multiple permissions though? I want to give, read, write, etc permissions to a single user

    At home I did man chmod and screwed up a bit, at least only one directory. Now I can't access it anymore without root. I did this:

    chmod -v -o /usr/local/src/

    And that set the bits to 0200, which only gave me (-w------)
    Which i think is only write access and now I can't read it...

  9. #9
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    i always use numbers coz its a bit easy for me.

    Code:
    chmod 755 <file>
    first digit for User, second for Group and third for others
    execute = 1, write = 2 and read = 4.
    you could use combinations for permissions. 700... user will have full control... 4+2+1 = 7
    755 user(7) = full control, Group(5) = read and execute (4+1) and same for others....

    create a new file and try different combinations of chmod xxx <rough file>




    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  10. #10
    Just Joined! vadre's Avatar
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    38

    Exclamation

    I Also have problems with this. I know how chmod works but i still can't copy anything to my external hard-drive however I can open everything. I just wanted to copy an srt-file to it and changed my /media/data/movies/ permission like that
    Code:
    sudo chmod 775 /media/Data/*
    When I do
    Code:
    ls -l
    now I see all directory's on my Data-drive have rwxrwxr-x permissions so normaly I should be able to copy there, no?

    regards

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •