0

I have my sd card and I have two partitions BOOT and rootfs. BOOT has the owner as user and rootfs has the owner as root. But i want to have owner of the directory BOOT be root and rootfs be the user. What has to be done?

When I am using the command sudo chown -R root BOOT/ I am getting an error "operation not permitted".

6
  • Command looks fine, except that you might also want to set group to "root" by specifying sudo chown -R root:root BOOT/. If you are being told that operation is not permitted, than you have no super user rights, simple as that. If you perform sudo touch 1.txt you get the same error? Aug 1, 2017 at 9:24
  • but following error message is coming... chown: changing ownership of 'BOOT/.Trash-1000/info/System Volume Information.trashinfo': Operation not permitted chown: changing ownership of 'BOOT/.Trash-1000/info': Operation not permitted chown: changing ownership of 'BOOT/.Trash-1000/files/System Volume Information/IndexerVolumeGuid': Operation not permitted chown: changing ownership of 'BOOT/.Trash-1000/files/System Volume Information': Operation not permitted
    – jenny
    Aug 1, 2017 at 9:28
  • I'm 100% sure .Trash-1000 should not be present on your BOOT partition, it's a trashbin folder, you might as well try to delete it with sudo rm -rf BOOT/.Trash-1000/. How about other files? Did all relevant files change an owner? Check it with ls -l BOOT/ Aug 1, 2017 at 9:36
  • ls -lart total 8 drwsrwxrwx+ 5 root root 4096 Aug 1 11:25 .. drwxr-xr-x 2 janani janani 4096 Aug 1 11:46 . nope when i checked with ls -lart these are present in my BOOT folder and the same error message when i tried to change owner... chown: changing ownership of 'BOOT/': Operation not permitted
    – jenny
    Aug 1, 2017 at 9:49
  • 1
    Is the partition by any chance a FAT partition? FAT does not support file ownership, but you can fake it via the uid=id mount option. This sets the owner of all files on the file system to id. Aug 1, 2017 at 10:51

1 Answer 1

0

Make sure that your /boot partition and your / partition actually are not mounted in ro mode and if you are operating from a live system then you can't change that but if it is a barebone system then you could change it.

run mount and post output of the command or better run mount | grep -i boot and check do you have ro flag which mean that your /boot partition is mounted in ReadOnly mode.

If its not a live system then you could run mount -o remount,rw /boot

if you get answer like cannot remount /boot read-write, is write-protected that mean that you are trying to mount ro volume as rw like the partition on CD/DVD or the iso image that was dd into the usb drive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .