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.

3
  • Can you remount the partion rw? mount -o remount,rw / Commented Oct 1, 2010 at 16:58
  • Do you use an initrd? If you use one, do you pivot the root file system? Commented Mar 22, 2011 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. Commented Dec 23, 2011 at 4:35

3 Answers 3

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

1
  • 1
    Even if this isnt the cause, the change should still be made. Commented Dec 23, 2011 at 6:52
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.

3
  • 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. Commented Oct 2, 2010 at 5:01
  • And yes, on a different VirtualBox guest I can mount the device for writing just fine. Commented Oct 2, 2010 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? Commented Oct 19, 2010 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.)

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! Commented Jan 3, 2014 at 16:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.