LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to change the ownership of files mounted from floppy image (http://www.linuxquestions.org/questions/linux-software-2/how-to-change-the-ownership-of-files-mounted-from-floppy-image-867184/)

osdevkid 03-08-2011 07:19 AM

How to change the ownership of files mounted from floppy image
 
Dear All,

I have mounted a floppy image file as below

$> su
$> /sbin/losetup /dev/loop0 /mnt/win_e/images/grubdos.img
$> mkdir /mnt/floppy
$> mount /dev/loop0 -o loop /mnt/floppy

Floopy image mounted on "/mnt/floppy", now I have tried to create a file inside the floppy image, file created successfully, however I can not change the ownership of the file.

$> cd /mnt/floppy
$> touch hai.txt
$> ll hai.txt
-rwxr-xr-x 1 root root 0 Mar 8 17:29 hai.txt
$> chown user1:user1 hai.txt
chown: changing ownership of 'hai.txt': Operation not permitted

How to change the ownership of the file and folder in mounted floppy image ?

ravikiran189 03-08-2011 07:42 AM

Hi,
From the ls-ltr i see the file hai.txt has root as its group & owner. you didn't say what linux you are using. You need root privilages for changing the ownership

login to root and try

#chown user1:user1 hai.txt

or try with sudo command
$sudo user1:user1 hai.txt

osdevkid 03-08-2011 08:03 AM

Thanks for your reply.

Quote:

need root privilages for changing the ownership

login to root and try
In the very first line itself, I have entered as root user.

Quote:

$> su
$> /sbin/losetup /dev/loop0 /mnt/win_e/images/grubdos.img
$> mkdir /mnt/floppy
$> mount /dev/loop0 -o loop /mnt/floppy

Quote:

or try with sudo command
$sudo user1:user1 hai.txt
I am using CentOS.

ravikiran189 03-08-2011 09:21 AM

hi,
Try using su - instead or login to root account and see if it works


All times are GMT -5. The time now is 04:25 PM.