Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set up a small linux system based on Gentoo on a VirtualBox machine, as a step towards deploying the same system onto a low-spec Single Board Computer. For some reason, my filesystem is being mounted read-only.

In my /etc/fstab, I have:

/dev/sda1   /         ext3    defaults    0 0
none        /proc     proc    defaults    0 0
none        /sys      sysfs   defaults    0 0
none        /dev/shm  tmpfs   defaults    0 0

However, once booted /proc/mounts shows

rootfs / rootfs  rw 0 0
/dev/root / ext3 ro,relatime,errors=continue,barrier=0,data=writeback 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
udev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0
none /dev/shm tmpfs rw,relatime 0 0
usbfs /proc/bus/usb usbfs rw,nosuid,noexec,relatime,devgid=85,devmode=664 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0

(the above may contain errors: there's no practical way to copy and paste)

The partition at /dev/hda1 is clearly being mounted OK, since I can read all the data, but it's not being mounted as described in fstab. How might I go about diagnosing / resolving this?

Edit: I can remount with mount -o remount,rw / and it works as expected, except that /proc/mounts reports /dev/root mounted at / rather than /dev/sda1 as I'd expect.

If I try to remount with mount -a I get

mount: none already mounted or /sys busy
mount: according to mtab, sysfs is already mounted on /sys

Edit 2: I resolved the problem with mount -a (the same error was occuring during startup, it turned out) by changing the sysfs and proc lines to

proc    /proc   proc   [...]
sysfs   /sys    sysfs  [...]

Now mount -a doesn't complain, but it doesn't result in a read-write root partition. mount -o remount / does cause the root partition to be remounted, however.

share|improve this question
    
Can you remount the partion rw? mount -o remount,rw / –  MattyB Oct 1 '10 at 16:58
    
Do you use an initrd? If you use one, do you pivot the root file system? –  Mircea Vutcovici Mar 22 '11 at 1:06
2  
You say /dev/sda1 in some spots, /dev/hda1 in other spots. Mixing the 2 up can cause the issues youre seeing, so make sure everything is referencing the proper device. –  Patrick Dec 23 '11 at 4:35

4 Answers 4

perhaps it is because the disk is unclean, try changing:

/dev/sda1   /         ext3    defaults    0 0

to

/dev/sda1   /         ext3    defaults    0 1

or at least do an fsck and then reboot

share|improve this answer
1  
Even if this isnt the cause, the change should still be made. –  Patrick Dec 23 '11 at 6:52

You say it's a VirtualBox machine... Does the VirtualBox process have write privileges to the datastore on the host?

mount -a remounts everything as described in /etc/fstab. If this is not behaving as expected, there may be some output in syslog. Check and post here if there is anything relevant.

share|improve this answer
    
I can't seem to find syslog on the machine, I don't know if it's been disabled in the distro I'm adapting, I'll have a look at re-enabling it. There doesn't seem to be any logging in /var/log, presumably because the device is read-only so nothing can be written. –  Tim Oct 2 '10 at 5:01
    
And yes, on a different VirtualBox guest I can mount the device for writing just fine. –  Tim Oct 2 '10 at 7:07
    
Oh, right -- /var/log would be read-only. If only you could edit /etc/syslog.conf you can try logging to a remote host. But then, if you could do that you wouldn't have a problem. Have you had any luck since this was originally posted? –  Aaron Copley Oct 19 '10 at 19:35

If your are running Ubuntu then try first removing ntfs-3g and then install by running - "aptitude install ntfs-config" This usually fixes it. (The problem is that if you installed some other version of ntfs driver (e.g. additional options og parted) then it does not have write capability.)

share|improve this answer
    
I must admit that the post about ntfs-3g didn't look like much to me.. But it was accurate enough to lead me to another solution! I just had this same problem after rebooting a working system. In my case, however, I had to unmerge dosfstols. Best wishes to you all! –  user204239 Jan 3 at 16:23

Can you check your

cat /proc/cmdline

Does it list rw in it? If not your grub configuration ist most likley missing the "rw" option.

Another reason may be a fault in the fs itself. Have a look at your dmesg.

share|improve this answer
    
This should be a comment. –  tristan Jan 3 at 21:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.