Unusual Failure Resolution exception when running a bash script on EC2 (Ubuntu)

I plugged in an EBS block and set it to "/ data" on my EC2 instance that runs Ubuntu 12.04. There is a backup copy of the script that works fine, but after moving the script folder to the "/ data / backup" folder, it cannot be executed with an error:

-bash: ./db_backup.sh: Permission denied

Resolution:

-rwxr-xr-x 1 ubuntu ubuntu 2.3K Nov 22 03:25 db_backup.sh

If I run it using "sudo", there is no error and no output, but there should be something like an echo for the console.

And I'm also trying to use "strace" to keep track of the exception I got:

execve("./db_backup.sh", ["./db_backup.sh"], [/* 19 vars */]) = -1 EACCES (Permission   denied)
dup(2)                                  = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =     0x7f354f010000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
close(3)                                = 0
munmap(0x7f354f010000, 4096)            = 0
exit_group(1)                           = ?

But if I put this script at some point, say, "/ tmp", this is not a problem. To narrow down the root cause, I also created a test script:

#!/bin/bash

echo "hello"

Unfortunately, this will not work if I put it in the / data folder.

+4
1

, noexec. :

mount | grep /data

, , - (rw,noexec) . noexec , , .

, , - . , , , , , - . script bash sh, :

sh db_backup.sh

UPDATE

@Doc :

. /etc/fstab, "exec" , "". , .

+7

All Articles