1

Why doesn't chmod work on a file under /media?

I am having similar problem. The aim is booting from a clean Ubuntu flash memory stick, then cloning and test-building a large repository onto a hard drive partition.

Unfortunately, my situation is under the restrictions that I can't copy the script, nor does the partition seem to be readonly of noexec.

Here is how the partition is mounted:

ubuntu@ubuntu:/media/ubuntu/data/test/0ad$ grep '/media/ubuntu/data' /etc/mtab | grep noexec
ubuntu@ubuntu:/media/ubuntu/data/test/0ad$ grep '/media/ubuntu/data' /etc/mtab
/dev/sda4 /media/ubuntu/data fuseblk rw,nosuid,nodev,allow_other,default_permissions,blksize=4096 0 0

Here is a demonstration of the problem:

ubuntu@ubuntu:/media/ubuntu/data/test/0ad/build/workspaces$ ll update-workspaces.sh 
-rw------- 1 ubuntu ubuntu 4608 Apr 16 06:41 update-workspaces.sh
ubuntu@ubuntu:/media/ubuntu/data/test/0ad/build/workspaces$ chmod +x update-workspaces.sh 
ubuntu@ubuntu:/media/ubuntu/data/test/0ad/build/workspaces$ ll update-workspaces.sh
-rw------- 1 ubuntu ubuntu 4608 Apr 16 06:41 update-workspaces.sh

I researched the mentioned mount options, but forund nothing suspecious.


Clarifications:

1. I can't move the script, because it is special in that it is a part of a larger build system, that I do not understand. I am following the build instructions for the application.

2. The problem is not with what the script contains, because I tried creating a simple script in the same folder, and that too can't be executed:

#!/bin/bash 
echo "Hello World!"`

3. sudo doesn't help.

4. Here is the full /etc/mtab, as requested. The partition I am trying to use is the last one data.

/cow on / type overlayfs (rw)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
/dev/sdb1 on /cdrom type vfat (ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/loop0 on /rofs type squashfs (ro,noatime)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/999/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=ubuntu)
/dev/sda6 on /media/ubuntu/2f54e44f-46ee-4e9d-a9b7-05963a5a6b61 type ext4 (rw,nosuid,nodev,uhelper=udisks2)
/dev/sda1 on /media/ubuntu/571CDF3F0AB7ABFD type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda2 on /media/ubuntu/0b4a4dc5-cf55-429d-85a5-ccb40c3796fc type ext4 (rw,nosuid,nodev,uhelper=udisks2)
/dev/sda4 on /media/ubuntu/data type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)

5. Underlying file system:

ubuntu@ubuntu:/media/ubuntu/data/test/0ad/build/workspaces$ sudo file -sL /dev/sda4
/dev/sda4: x86 boot sector

According to GParted, this is a primary ntfs partition. I have a Windown 7 on another partition and an Ubuntu on another set of partitions:

enter image description here

Vorac
  • 319
  • 4
  • 17
  • Have you tried using sudo? The permissions/account might be a little strange on "live" Ubuntu. – Gary Apr 16 '15 at 12:18
  • 1
    What's the underlying filesystem of the /dev/sda4 block device (e.g. sudo file -sL /dev/sda4)? – steeldriver Apr 16 '15 at 12:30
  • I recommend also including the output of mount. ...Also, does the script actually have to be run as an executable, or would it be acceptable to pass its name to the interpreter (e.g., sh update-workspaces.sh, assuming it really is intended to be run by sh). If you know that won't work, I suggest expanding your question to explain why--otherwise, I suggest posting the first few lines of the script (or at least the first line) so someone can answer with specific details about what interpreter to invoke for it. – Eliah Kagan Apr 16 '15 at 16:00
  • @steeldriver, please see point five from my edited question. – Vorac Apr 17 '15 at 07:19

0 Answers0