Many times, you need to share documents and accessories within the local work station, which lessens individual disk space & allows access to devices, such as printers, scanners, CD/DVD drives, floppy drives etc... While working on a Linux system, if you want to share any of your documents, files or folders within the LAN or the NFS (Network File System), you need to change the ownership of the associated Linux volume.
Suppose a more complex situation, when the only way to access some of your data is through the sharing of the drive. You have certain problems with your root account and you neither able to run some applications nor access the related documents. Moreover, while trying to change the ownership of your mounted Linux hard drive volume, you are receiving a series of error messages. This is a serious situation of data inaccessibility and you need any Linux recovery
utility to resolve the issue in order to regain the access to the valuable data.
The error messages that you encounter while trying to change the ownership of the drive can be read as follows:
"suse:/# chown -v ryan:ryan /mnt/hdc1
failed to change ownership of `/mnt/hdc1' to ryan:ryan
chown: changing ownership of `/mnt/hdc1': Operation not permitted
suse:/# chmod -v 777 /mnt/hdc1
mode of `/mnt/hdc1' changed to 0777 (rwxrwxrwx)
suse:/# ls -l /mnt/
drwxr-xr-x 4 root root 16384 1969-12-31 17:00 hdc1
Following reasons may be behind the above error message:
Incorrect setting of attributes of directory or file, which is preventing you from changing disk permissions using the command 'chmod'.
The root directory has been damaged and hence, the operating system could not be able to read the structure of the disk.
Corruption to the file system, the superblock or the iNode.
In oder to resolve the issue, follow the below steps(if you have the root access):
Check your user-ID (UID).
With root access, from the terminal edit '/etc/fstab' by sudo gedit /etc/fstab
Try pasting the the values, umask=0000, uid=your UID valuae, gid=your GID value in the section, save and exit.
In the terminal run: sudo umount -a
In the terminal run: sudo mount -a
If you still facing the same error, the corruption is because of the corruption of the file system/superblock/inode. In such a case, you have to format and make a fresh installation of the operating system. After formatting, you have to restore the data from the backup, failing to which you require any Linux data recovery software
to recover back the data.