The root user's permission to modify files in the media folder is invalid.

Source: Internet
Author: User

The root user's permission to modify files in the media folder is invalid.

Http://blog.csdn.net/pipisorry/article/details/39649699

Problem:

I want to execute a program written by myself in the media folder, but cannot execute

The owner of the media folder is root.

root@ubuntu:/#ls -ld /mediadrwxr-xr-x 5 root root 1024 Sep 29 00:08 /media
So I enter commands on the terminal as root. Chmod a + x 1, No response after the carriage return, and the query of the folder's properties has not changed. Why?
Root @ ubuntu:/media/000b089d424696f/mine/C ++/POJ/CCF # cp RevNum. cpp 1. cpproot @ ubuntu:/media/000b089d424696f/mine/C ++/POJ/CCF # vim 1. cpproot @ ubuntu:/media/000b089d424696f/mine/C ++/POJ/CCF # gcc-o 1. cpproot @ ubuntu:/media/000b089d424696f/mine/C ++/POJ/CCF #. /1 bash :. /1: insufficient permissions. root @ ubuntu: /media/000B089D0000696F/mine/C ++/POJ/CCF # ls-l 1-rw ------- 1 pipi 8463 Sep 29 1root @ ub Untu:/media/000b089d424696f/mine/C ++/POJ/CCF # chmod a + x 1root @ ubuntu: /media/000b089d424696f/mine/C ++/POJ/CCF # ls-l 1-rw ------- 1 pipi 8463 Sep 29 1 => the permission has not changed, still unable to execute !!!

Solution:

1. log on to the GUI as root

For logon methods, see [add, delete, and modify users in linux]

2. Use mount to solve the problem

Sudo umount/media/administrator/movie
Sudo mount-o rw/dev/sda7/media
When media is mounted, sudo umount/media is used for removal.

Ps:

The reason why many files in the media folder are read-only:

The reason for read-only is that the quick Restart Technology of win8 after enabling the other system to write the partition will lead to data loss, so ntfs-3g (ntfs support module on linux) by default prohibit ntfs write operations
In addition, do not modify permissions for folders under /.

Simple mount usage:
Root permission required
Mount partition mount point
Partition: similar to/dev/sda1
Mount point: destination folder, preferably empty

Example:Mount the first partition (sda1) to/home/xxx/
Mount/dev/sda1/home/xxx/
Unmount only umount mount points
(Add sudo with the above command)
In addition, the/file should not be modified
Media (null) Permission
Sudo chmod 755/media

From: http://blog.csdn.net/pipisorry/article/details/39649699

Ref: Command for modifying folder Permissions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.