- How to make read-only file system writable?
- 7 Answers 7
- Thread: Command to make a file writable?
- Command to make a file writable?
- Re: Command to make a file writable?
- Re: Command to make a file writable?
- Tags for this Thread
- Bookmarks
- Posting Permissions
- How to make an ext4 file writable on mounting by a user (not root)
- 3 Answers 3
How to make read-only file system writable?
At some point, the filesystem on my digital audio player has become read-only. I cannot copy files into it or remove files on it. Are there some possible reasons for the player’s file system to change permissions in this way? I tried using chmod :
$ sudo chmod a+rw SGTL\ MSCN/ chmod: changing permissions of `SGTL MSCN/': Read-only file system
Could you also add brand of the player? 🙂 searching ‘SGTL MSN’ actually ONLY brings up this topic 😀 If you are really unlucky it’s the device that’s bugged: as a last(!) resort reset the player. But only when you do not get any good anwsers soon(ish) 🙂
Tried everything, and found a simple solution (heretic). Plug the usb to windows 8 or 7, click «repair external drive», go back to linux. Hope this helps someone.
7 Answers 7
If a filesystem has been mounted read-only, chmod will not work since it’s a write operation too.
Try remounting it read-write:
sudo mount -o remount,rw '/media/SGTL MSCN'
If the device has a write lock on it (like SD memory cards), you need to turn it off. Hardware locks cannot be disabled by software. Note that the write lock on SD memory cards is located from the sight you see the letters near the up left corner and it looks like a very small switch.
Some filesystem drivers may also not support write operations, this is the case with the older NTFS module supported by Linux. For NTFS filesystems, be sure to use the ntfs-3g driver which should be picked automatically nowadays. If not, you can force the driver with something like:
sudo mount -t ntfs-3g -o uid=$(id -u) /dev/sdb1 /mnt/
(where /dev/sdb1 has to be substituted for your block device and /mnt/ for your destination)
@XavierStuvw If read/write protected means readonly, ok. Otherwise you could try to wipe it and repurpose it. The wipefs command can be used on a partition to ensure that no filesystem is recognized. See man wipefs (part of util-linux).
@JoshuaSalazar how did you mount it? Perhaps you could create a new question and include such details, this comment section is getting a bit too large.
For NTFS file systems this problem may occur when it is not properly unmounted (probably by unexpected shutdown of windows). In such cases the file systems are marked as locked.
You can mount them properly using the following ntfsfix command, for example:
Please replace /dev/sda3 with your own device name.
I’d like to add for future Googlers that doing this fixed the «New Steam library folder must be on a filesystem mounted with execute permissions» on Manjaro Linux and it’s probably the same for other distros.
Thanks for this! I’m dual booting Kubuntu and Windows 10 and I could not understand why sometimes I’m unable to mount a disk with write permissions!
I had this problem occur on several USB sticks. Each time I searched for an answer and tried various suggestions, including using Terminal to run commands, reformatting on both Linux and Windows machines, etc. All to no avail.
It happened to me again today so again I went looking to see if I could find a solution. I tried the things here, but they didn’t work.
Out of desperation I again went to Disk Utility. I unmounted the drive and then hit «Format» on the partition portion, not the drive portion — USB only had the single partition. This time it WORKED. Then I went to the drive portion and again reformatted the single partition as a master boot drive and monkeyed a bit more with it.
The upshot is, I’m now able to read and write to the drive again.
I don’t know if I just got lucky this time or not. But it is working again.
Thread: Command to make a file writable?
First Cup of Ubuntu
Command to make a file writable?
(First post. Woo. Also, if this happens to be the wrong catagory. well, my bad.)
Since there has to be a command for this, what’s the command for making a read-only file writable? I need it becuase I’m trying to change my default window manager back to Gnome, since I can’t get X to start, but the file containing that precious setting? Read-only.
Dark Roasted Ubuntu
Re: Command to make a file writable?
will give the owner of file the permission to write to it.
will give the owner and group of file permission to write to it.
Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way. —Christopher Hitchens
First Cup of Ubuntu
Re: Command to make a file writable?
As for my little X issue, I got it working. Thank you failsafe backup xorg.conf file!
- Site Areas
- Settings
- Private Messages
- Subscriptions
- Who’s Online
- Search Forums
- Forums Home
- Forums
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- New to Ubuntu
- General Help
- Installation & Upgrades
- Hardware
- Desktop Environments
- Networking & Wireless
- Multimedia Software
- Ubuntu Specialised Support
- Ubuntu Development Version
- Security
- Virtualisation
- Ubuntu Servers, Cloud and Juju
- Server Platforms
- Ubuntu Cloud and Juju
- Gaming & Leisure
- Emulators
- Wine
- Development & Programming
- Packaging and Compiling Programs
- Development CD/DVD Image Testing
- Ubuntu Application Development
- Ubuntu Dev Link Forum
- Programming Talk
- Repositories & Backports
- Ubuntu Backports
- Bug Reports / Support
- Ubuntu Backports
- System76 Support
- Apple Hardware Users
- Ubuntu Community Discussions
- Ubuntu, Linux and OS Chat
- Recurring Discussions
- Full Circle Magazine
- The Cafe
- Cafe Games
- Market
- Mobile Technology Discussions (CLOSED)
- Announcements & News
- Weekly Newsletter
- Membership Applications
- The Fridge Discussions
- Forum Council Agenda
- Forum Feedback & Help
- Request a LoCo forum
- Resolution Centre
- Ubuntu, Linux and OS Chat
- Other Discussion and Support
- Other OS Support and Projects
- Other Operating Systems
- Ubuntu/Debian BASED
- Debian
- MINT
- Arch and derivatives
- Fedora/RedHat and derivatives
- Mandriva/Mageia
- Slackware and derivatives
- openSUSE and SUSE Linux Enterprise
- Mac OSX
- PCLinuxOS
- Gentoo and derivatives
- Windows
- BSD
- Any Other OS
- Other Operating Systems
- Assistive Technology & Accessibility
- Art & Design
- Education & Science
- Documentation and Community Wiki Discussions
- Tutorials
- Outdated Tutorials & Tips
- Ubuntu Women
- Ubuntu LoCo Team Forums
- Americas LoCo Teams
- Argentina Team
- Software
- Hardware
- Comunidad
- Arizona Team — US
- Arkansas Team — US
- Brazil Team
- California Team — US
- Canada Team
- Centroamerica Team
- Chile Team
- Comunidad
- Hardware
- Software
- Instalaci�n y Actualizaci�n
- Colombia Team — Colombia
- Georgia Team — US
- Illinois Team
- Indiana — US
- Kentucky Team — US
- Maine Team — US
- Minnesota Team — US
- Mississippi Team — US
- Nebraska Team — US
- New Mexico Team — US
- New York — US
- North Carolina Team — US
- Ohio Team — US
- Oklahoma Team — US
- Oregon Team — US
- Pennsylvania Team — US
- Peru Team
- Texas Team — US
- Uruguay Team
- Utah Team — US
- Virginia Team — US
- West Virginia Team — US
- Argentina Team
- Asia and Oceania LoCo Teams
- Australia Team
- Bangladesh Team
- Hong Kong Team
- Myanmar Team
- Philippine Team
- Singapore Team
- Europe, Middle East, and African (EMEA) LoCo Teams
- Albania Team
- Catalan Team
- Portugal Team
- Egypt Team
- Georgia Team
- Ireland Team — Ireland
- Kenyan Team — Kenya
- Kurdish Team — Kurdistan
- Lebanon Team
- Morocco Team
- Saudi Arabia Team
- Sudan Team
- Tunisia Team
- Other Forums & Teams
- LoCo Archive
- Afghanistan Team
- Alabama Team — US
- Alaska Team — US
- Algerian Team
- Andhra Pradesh Team — India
- Austria Team
- Bangalore Team
- Bolivia Team
- Cameroon Team
- Colorado Team — US
- Connecticut Team
- Costa Rica Team
- Delhi Team
- Ecuador Team
- El Salvador Team
- Florida Team — US
- Galician LoCo Team
- Greek team
- Hawaii Team — US
- Honduras Team
- Idaho Team — US
- Iowa Team — US
- Jordan Team
- Kansas Team — US
- Libya Team
- Louisiana Team — US
- Maryland Team — US
- Massachusetts Team
- Michigan Team — US
- Missouri Team — US
- Montana Team — US
- Namibia Team
- Nevada Team — US
- New Hampshire Team — US
- New Jersey Team — US
- Northeastern Team — US
- Panama Team
- Paraguay Team
- Qatar Team
- Quebec Team
- Rhode Island Team — US
- Senegal Team
- South Carolina Team — US
- South Dakota Team — US
- Switzerland Team
- Tamil Team — India
- Tennessee Team — US
- Trinidad & Tobago Team
- Uganda Team
- United Kingdom Team
- US LoCo Teams
- Venezuela Team
- Wales Team
- Washington DC Team — US
- Washington State Team — US
- Wisconsin Team
- Yemen Team
- Za Team — South Africa
- Zimbabwe Team
- Americas LoCo Teams
- Other OS Support and Projects
- Ubuntu Official Flavours Support
Tags for this Thread
Bookmarks
Bookmarks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
vBulletin �2000 — 2023, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical � Canonical Ltd. Tango Icons � Tango Desktop Project.
User contributions on this site are licensed under the Creative Commons Attribution Share Alike 4.0 International License. For details and our forum data attribution, retention and privacy policy, see here
How to make an ext4 file writable on mounting by a user (not root)
I think your fmask option is too strict and gives no read permission on files to group and other . Set it to fmask=000 or just leave it out to get rw- permissions on all files. You shouldn’t have executable permissions by default.
Also, I think the gid option only accepts group id numbers, so it should read gid=100 instead. And you should add the rw option (I forgot mentioning that).
No need to add rw . It’s the default behaviour. It’s ro that must be specified explicitly. However, users should be user .
3 Answers 3
You can’t; ext[234] doesn’t support the uid/gid options or any other way of overriding the on disk permissions at mount time. You must set the permissions correctly on the disk as root.
A similar question came up to me on [How fstab mount options work together with per file defined permissions in linux and got a detailed answer by the community!
The thing with etx4 is that the mount options in fstab are used in combination to the permissions stored for each file. This is of course contrary to NTFS that does not have any linux permissions associated per file and thus takes such arguments from the fstab mount options only.
So, in order to make a file stored in an EXT4 filesystem writable by a certain user you need to both:
1) mount the disk with rw or defaults to enable writing to the filesystem in general AND
2) have a set of permissions set for each file such as the user CAN write to it, this can be achived with various ways..
a)If the file is owner by the user and write permission is granted to the owner
[sudo] chown user:user file
[sudo] chmod u+w file
b)If the file is owned by the group the user belongs to and write permission is granted to the group
[sudo] chown other_user:users file
[sudo] chmod g+w file
c) if the file is granted permission to write by anyone: