How do I remount a filesystem as read/write?

1

My cat walked over my keyboard and pressed "magical" SysRq u, doing an Emergency Remount R/O. How do I reverse this?

On How do I remount a filesystem as read/write?, SirCharlo claims

The correct syntax is:

sudo mount -o remount,rw /partition/identifier /mount/point

but that just yields another error,

mount: you must specify the filesystem type

and if I supply it, e.g.,

$ sudo mount -t ext4 -o remount,rw /dev/sda7 /

I'm back at the error message the OP reported,

mount: / not mounted or bad option

That diagnostic begs the question, which? Not mounted, or bad option? The exit status is 32, and man mount provides this key:

mount has the following return codes (the bits can be ORed): 0 success 1 incorrect invocation or permissions 2 system error (out of memory, cannot fork, no more loop devices) 4 internal mount bug 8 user interrupt 16 problems writing or locking /etc/mtab 32 ...
0 0
2

Question: I booted Ubuntu into recovery mode to fix a configuration file, but I noticed that the root filesystem is mounted as read-only. How can I remount a filesystem as "read-write" in Ubuntu recovery mode?

When you enter a recovery mode in Ubuntu, the root filesystem gets mounted as "ready-only" by default, not allowing you to update or recover any file in the root file system.

You can actually remount a filesystem as read-write on-the-fly by using mount command.

To remount the root filesystem as read-write:

# mount -o rw,remount /

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.


Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support...

0 0
3

The correct syntax is:

sudo mount -o remount,rw /partition/identifier /mount/point

Where mount/point is /partition/identifier‘s corresponding mountpoint, as listed by the following command:

mount -v | grep "^/" | awk '{print "\nPartition identifier: " $1 "\n Mountpoint: " $3}'

For example, say that the above command gives this:

Partition identifier: /dev/sda1 Mountpoint: / Partition identifier: /dev/sda2 Mountpoint: /boot Partition identifier: /dev/sda3 Mountpoint: /test

The following would be the correct syntax. (We start by unmounting it, if it’s already mounted.)

sudo umount /test sudo umount /dev/sdb3 sudo mount -t hfsplus -o rw,remount -force /dev/sdb3...
0 0
4
Remount root filesystem readonly

location: linuxquestions.com - date: April 20, 2007
Hello, How can I remount the root filesystem read-only? I want to do that because i want to make a filesystem check with fsck. Thanks!

[SOLVED] how can i remount root filesystem as read/write after modify readonlyroot file

location: linuxquestions.com - date: December 20, 2010
Hi, My linux distro is CentOS 5.3. Today I edited /etc/sysconfig/readonly-root and set "READONLY" to yes, now my /etc/sysconfig/readonly-root file is like this: # Set to 'yes' to mount the system filesystems read-only. READONLY=yes # Set to 'yes' to mount various temporary state as either tmpfs # or on the block device labelled RW_LABEL. Implied by READONLY TEMPORARY_STATE=no # Place to put a tmpfs for temporary scratch writable space RW_MOUNT=/var/lib/stateless/writable # Label on local filesystem which can be used for temporary scratch space RW_LABEL=stateless-rw # Label for partition with...

0 0
5
H

ow do I remount partition on FreeBSD operating systes? How do I mount/remount read-only partition in read-write mode without rebooting the systems?


Linux or other Unixish operating systems need to pass the

-o remount

option to the

mount(8)

command to remount partition. However, FreeBSD does not require any special option to remount file system. It can use your standard mount command. The mount utility calls the

mount(2)

system call to prepare and graft a special device or the remote node (rhost:path aka NFS) on to the file system tree at the point node. For example, if your file system is mounted in read only mode then you can remount it using the following command. First, login as root user.

Freebsd remount disk command example

Type the following command as the root user (superuser):
# mount -o rw /dev/ad0s1a /
OR
# mount -o rw /
Where,

-o : Takes different options as follows: rw : Read write mount. ...
0 0
6

Linux (and Android) have the ability to mount a file system read only to prevent unauthorised modification, particularly to system files. This guide shows you how to remount these file systems so that changes can be made.

In this guide I will be showing you how to remount filesystem read-write using the Android operating system on a smartphone, however since it is Linux based this guide should work on most variants and distributions of Linux.

The system partition on Android is read only to prevent application or user changes which may adversely affect the operation or function of the device, however these are some instances where it is useful to have access to write information to the system partition, for example removing bloatware, changing the hosts file or modifying init.d.

If you do not have access to write to the partition your request to save or change data will result in a "Permission Denied" error. To get around this, you need to remount filesystem...

0 0
7

Suppose you are logged into your Android device using adb or perhaps by means of a console app, and you require write access to /system then do as following

Become root

# su

Check how the /system partition is mounted as read-only (ro), In particular note the device

# mount | grep system

/dev/block/stl12 /system ext4 ro,relatime,barrier=1,data=ordered 0 0

Remount the partiton in read-write mode (rw)

# mount -o rw,remount /dev/block/stl12 /system

Finally check if it was mounted in read-write mode (rw)

# mount | grep system
/dev/block/stl12 /system ext4 rw,relatime,barrier=1,data=ordered 0 0

When done, do not forget to remount it read-only again, for safety reasons, obviously

# mount -o ro,remount /dev/block/stl12...

0 0
8

Once you insert new hard disks into your system, you’ll typically use utilities like fdisk or parted to create partitions. Once you create a partition, you’ll use mkfs command to create ext2, ext3, or ext4 partition.

Once you create a partition, you should use mount command to mount the partition into a mount point (a directory), to start using the filesystem.

This tutorial explains everything you need to know about both mount and umount command with 15 practical examples.

The general mount command syntax to mount a device:

mount -t type device destination_dir

1. Mount a CD-ROM

The device file for CD would exist under /dev directory. For example, a CD-ROM device will be mounted as shown below.

# mount -t iso9660 -o ro /dev/cdrom /mnt

In the above example, the option “-o ro” indicates that the cdrom should be mounted with read-only access. Also, make sure that the destination directory (in the above example, /mnt) exist before you...

0 0
9

If you've visited Android Police over the past weekend, you've probably already seen my enthusiastic review of Total Commander for Android, which for me is replacing both ASTRO and Root Explorer going forward as the top Android file manager. Ad-free, $0, root support, dual panes, plugin support, and other advanced functions, which you can read about in the review, make Total Commander an easy choice for both novice and advanced users.

However, one task that is not immediately achievable (or so I thought) with Total Commander is something that sits right at the core of Root Explorer - writing to read-only partitions, such as /system. Root Explorer has a handy "Mount RW" button, which re-mounts such read-only partitions for writes, but Total Commander doesn't seem to offer this functionality. Bummed, I emailed the developer with a feature request, only to be enlightened by a helpful reader Sleeepy2 minutes later.

Apparently, I could re-mount partitions as read-write in...

0 0
10

The correct syntax is:

sudo mount -o remount,rw /partition/identifier /mount/point

Where mount/point is /partition/identifier's corresponding mountpoint, as listed by the following command:

mount -v | grep "^/" | awk '{print "\nPartition identifier: " $1 "\n Mountpoint: " $3}'

For example, say that the above command gives this:

Partition identifier: /dev/sda1 Mountpoint: / Partition identifier: /dev/sda2 Mountpoint: /boot Partition identifier: /dev/sda3 Mountpoint: /test

The following would be the correct syntax. (We start by unmounting it, if it's already mounted.)

sudo umount /test sudo umount /dev/sdb3 sudo mount -t hfsplus -o rw,remount -force /dev/sdb3...
0 0
11

So, this is it. Everything is working as usual except the disk is read only and dont want to change back.

^_^! thanks.

root@NODE02:/tmp# df . Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda5 461490504 179502128 258545928 41% / root@NODE02:/tmp# mount -o rw,remount /dev/sda5 mount: cannot remount block device /dev/sda5 read-write, is write-protected root@NODE02:/tmp# touch helll touch: cannot touch `helll': Read-only file system

It's not multipath. It's nothing special. Just a server with ubuntu 9.10.

makes no sense for me, does it?

----EDIT----

Selinux is not active.

There is no RAID. There are 2 discs, 500Gb each one. First one for OS and some homes. Second one for distributed FS, HPC high performance.

Dmesg was not updated since 2 days ago. Nothing on it's last lines related to disc or errors.

Rebooted, and no hard drive found. From bios the hard drive is dead, not responding even to name...

0 0
12

You can run the mount command without parameter in order to get partition information before constructing your mount command. Here is an example of the mount command without parameter outputed from my HTC Hero.

$ mount mount rootfs / rootfs ro 0 0 tmpfs /dev tmpfs rw,mode=755 0 0 devpts /dev/pts devpts rw,mode=600 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0 none /dev/cpuctl cgroup rw,cpu 0 0 /dev/block/mtdblock3 /system yaffs2 rw 0 0 /dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0 /dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0 /dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid= 1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,s hortname=mixed,utf8,errors=remount-ro 0...
0 0
13

5.10.1. What are filesystems?

A filesystem is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk. The word is also used to refer to a partition or disk that is used to store the files or the type of the filesystem. Thus, one might say ``I have two filesystems'' meaning one has two partitions on which one stores files, or that one is using the ``extended filesystem'', meaning the type of the filesystem.

The difference between a disk or partition and the filesystem it contains is important. A few programs (including, reasonably enough, programs that create filesystems) operate directly on the raw sectors of a disk or partition; if there is an existing file system there it will be destroyed or seriously corrupted. Most programs operate on a filesystem, and therefore won't work on a partition that doesn't contain one (or that contains one of the wrong...

0 0
14

Have you tried to match permissions?

By default, Mac OS X formats volumes in journaled HFS+ volumes. Journaling is a feature that improves data reliability, and unfortunately it makes HFS drives read-only in Linux.

To disable journaling, just boot into OS X and fire up Disk Utility. Click on your HFS partition, hold the Option key, and click File in the menu bar. A new option to Disable Journaling will come up in the menu. Click that, and reboot into Linux. You should have read and write access to your HFS partition—however, the permissions on your Mac user's home folder will prevent you from reading or writing those files. we just need to change our UID in one OS so that it matches the UID in the other. Unless you have a reason for choosing otherwise, we're going to change our Linux UID to match our OS X one, since it's a bit easier. By default, the first user in OS X has a UID of 501, but you can double check this by going into System Preferences in OS X,...

0 0