[SOLVED] Can only write to mounted IMG file as root.
CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've run into a slight issue on Centos 7. I can mount an IMG file with sudo mount -o loop ..., but I cannot write anything to the mounted image unless I'm root. I've noticed that when I mount the image, the ownership of the mount point changes to root:root. I'm not an expert at *NIX, but not a newbie, either. Somewhere in the middle. But I'm sure I'm overlooking something here. I shouldn't have to sudo every time I want to write to a floppy image. I even tried adding rw to the mount command. No luck. Any and all help appreciated.
I know about fstab, but these are IMG files of floppies that I want to be able to mount/unmount on the fly. These have to be mounted on the loop device. It works fine, as long as I'm root. I know that only root can mount/unmount, but I find it strange that other users can't have write access to the mounted image. I've tried setting both the mount point and image files to 666, as well as adding my non-root user to the "disk" group, as /dev/loop0 ownership is root:disk. Still no luck.
Yes, me too. You just have to live with the trade-off between ease of ingress and insecurity. Anyone with a usb drive could hack windows for decades. They're making it inconvenient now, but not difficult. It's not easy in linux.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.