Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
I just loaded PETSc (numerical library) on my new WD Passport USB drive and tried: $ ./configure and got: bash: ./configure: Permission denied I then checked permissions: $ ls -l ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    10

    Can't change permission on files on my new WD Passport (on Fedora 16)


    I just loaded PETSc (numerical library) on my new WD Passport USB drive and tried:

    $ ./configure

    and got:

    bash: ./configure: Permission denied

    I then checked permissions:

    $ ls -l configure
    -rw-------. 1 jski jski 340 Aug 31 12:33 configure

    I don't have execute permission.

    Tried: $ chmod 777 configure

    No change.

    Tried: $ su -c 'chmod 777 configure'

    No change.

    What gives?

    How can I change permissions on files on this USB drive/device (on Fedora 16)?

    BTW, looked on the web (ask.fedoraproject.org) and found this:

    Q: I've just installed Fedora 16 after having FC11 for 3 years or so. What I noticed is that my USB media is connected and accessible, but it's impossible to change permissions (using FAT32 and NTFS volumes) and it is given 'rw' only for the owner, so it is impossible to execute linux applications on that volume or scripts.
    I would really appreciate your help. Reading through the internet for the last 5 hours didn't yield much and the user interface tools don't match.

    A: I'm guessing this is because the devices are mounted as noexec by default. Verify this by running mount in a terminal. For a temporary workaround, you can try changing the permissions on the folders by using chmod as root. I'll have to dig up how one can change default mount parameters for USB devices, probably using policy kit.

    ---John

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    What file system is the drive formatted as? It is likely either NTFS or FAT. You cannot use FAT file systems for running Linux software since they don't support the required file/directory attributes. Ditto NTFS for the most part. You need to reformat the drive to use a Linux/Unix file system, such as ext2/3/4, ufs, xfs, jfs, etc.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Posts
    10
    Probably FAT32.

    Newbie question: what is the best/preferred way to reformat the drive?

    ---John

  4. #4
    Just Joined!
    Join Date
    Feb 2012
    Posts
    10
    mkfs.ext4 /dev/sdb1 ???

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    1. Boot system.
    2. Plug drive in.
    3. After it automounts, right click on the icon and check the properties to see what device it is, such as /dev/sdb1, etc.
    4. Since you already downloaded the application (probably as a compressed tar file), then copy that to your system drive. Copying it to /tmp would be just fine. That way you won't have to download it again.
    5. Right click on the icon again, and select "unmount". This will make the icon go away - that's ok.
    6. Open a terminal / command-line window and switch to root with the command "su -" - it will ask for your root password. Not necessary if you originally logged in as root.
    7. Now, format the file system. The current preferred file system for Linux is ext4, so do this (assuming the drive's file system was on /dev/sdb1):
    Code:
    mkfs -t ext4 -c /dev/sdb1
    The -c option will scan the hard drive for bad sectors and map those out of use if it finds any, before it creates the actual file system. This is optional, but good practice, and will give you time to go get a nice cup of coffee while you wait!

    Once the file system is created, you should be able to remove it, plug it back in, and verify that it will still auto-mount ok. Assuming it does, then you can create a user-accessible directory on the drive (which will be mounted in /media) to hold your data, and move the file you copied to /tmp there. I do stuff like this all the time, and I create a link in my user space to the directory so when it is connected to the system all I have to do is cd to that directory in order to configure and build stuff I loaded there.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    Quote Originally Posted by jski View Post
    mkfs.ext4 /dev/sdb1 ???
    One can use the specific mkfs.type directly, but it is not recommended, especially for newbies.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Feb 2012
    Posts
    10
    Checking in /etc/mtab (before the device is unmounted/"ejected") I find:

    /dev/sdb1 /media/Passport fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,defa ult_permissions,allow_other,blksize=4096 0 0

    I tried:

    # mkfs -t ext4 -c /dev/sdb1
    mke2fs 1.41.14 (22-Dec-2010)
    Could not stat /dev/sdb1 --- No such file or directory
    The device apparently does not exist; did you specify it correctly?


    Properties simply says: Location: /media

    Should I try:

    # mkfs -t ext4 -c /media

    ???

    ---John

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    Quote Originally Posted by jski View Post
    Checking in /etc/mtab (before the device is unmounted/"ejected") I find:

    /dev/sdb1 /media/Passport fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,defa ult_permissions,allow_other,blksize=4096 0 0

    I tried:

    # mkfs -t ext4 -c /dev/sdb1
    mke2fs 1.41.14 (22-Dec-2010)
    Could not stat /dev/sdb1 --- No such file or directory
    The device apparently does not exist; did you specify it correctly?


    Properties simply says: Location: /media

    Should I try:

    # mkfs -t ext4 -c /media

    ???

    ---John
    You cannot format a mounted volume. You have to unmount it first! No, you need to use the device id, /dev/sdb1 to reformat the partition, and you have to be root to do that.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Feb 2012
    Posts
    10
    I did unmount it first (using the "eject" icon in Nautilus) .

    Then I tried:

    # mkfs -t ext4 -c /dev/sdb1


    and got:

    mke2fs 1.41.14 (22-Dec-2010)
    Could not stat /dev/sdb1 --- No such file or directory
    The device apparently does not exist; did you specify it correctly?


    ---John

  10. #10
    Just Joined!
    Join Date
    Feb 2012
    Posts
    10
    BTW, I am logged in as root when doing this.

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
  •