db2_install do not have write permission on the directory or file This is the error I encountered (I ran the db2_install and everything else as root,):

DBI1288E  The execution of the program /home/DB_SERVER/ibm/db2/v10.5 failed. This
      program failed because you do not have write permission on the
      directory or file .


I tried to change the access permission of the path:

chmod -R a+rw /home/DB_SERVER/ibm/db2/v10.5


And then I could create a new file in that folder:

vi test


Result of ll in that directory:

total 1
-rw-rw-rw- 1 root root 12 Nov 23 00:24 test


But when I ran the db2_install again, it failed for the same reason.

PS: I tried to change permission of the setup file too

chmod -R a+rwx db2Setup/


Result of ll

total 72
drwxrwxrwx  6 root root 4096 Nov 23 00:10 db2
-rwxrwxrwx  1 root root 5349 Nov 23 00:10 db2ckupgrade
-rwxrwxrwx  1 root root 5302 Nov 23 00:10 db2_deinstall
-rwxrwxrwx  1 root root 5172 Nov 23 00:10 db2_install
-rwxrwxrwx  1 root root 5136 Nov 23 00:10 db2ls
-rwxrwxrwx  1 root root 5154 Nov 23 00:10 db2prereqcheck
-rwxrwxrwx  1 root root 5154 Nov 23 00:10 db2setup
drwxrwxrwx 10 root root 4096 Nov 23 00:10 ibm_im
-rwxrwxrwx  1 root root 5190 Nov 23 00:10 installFixPack
drwxrwxrwx  4 root root 4096 Nov 23 00:10 nlpack
-rw-r--r--  1 root root    8 Nov 23 01:00 test


So I have no idea what's wrong? How to fix this?
if you install on mounted fs ensure it's not mounted with the nosuid and noexec parameters.
db2 binaries require suid file permissions.
remove v10.5 directory if you created it manually
and set chmod 755 on parent directory