4

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.

Tim
  • 257
  • 4
  • 5
  • 12

3 Answers3

5

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

freedenizen
  • 151
  • 1
  • 2
2

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.

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
  • 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 02 '10 at 05:01
  • And yes, on a different VirtualBox guest I can mount the device for writing just fine. – Tim Oct 02 '10 at 07: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
1

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.)

anonyn
  • 11
  • 1
  • 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! –  Jan 03 '14 at 16:23