Solved Remounting fs as read-write

July 20, 2005 at 04:36:28
Specs: Suse 9.1 Pro, Celeron 566, 256MB

I tried to add a second hard drive to my Suse PC, but after I partitioned it and formatted it as /usr (selected by Suse as default) I discovered a lot of my installed programs were nowhere to be found. I tried rebooting but I could no longer get to a desktop, so I removed the second hard drive again, thinking it would all be back to normal. However it now goes into a "diagnostic mode", and asks me to "do" bash# mount -n -o remount,rw /
but when I type this line I get bash#: Command not found
How do I repair all my senseless vandalism? Or will I have to reinstall Suse off discs and start from scratch?

Tommy.


See More: Remounting fs as read-write

Report •


#1
July 20, 2005 at 04:40:00

Leave out "bash#" as that only indicates a root bash prompt....you want to be typing just:
mount -n -o remount,rw /

FYI you may see command on this and other forums given with a prompt, a "#" indicates a root prompt and a "$" is for just a regular user, eg:
# mount -n -o remount,rw /
or
$ ls /home/user
When using these commands leave out the # or $.


Report •

#2
July 20, 2005 at 05:00:37
✔ Best Answer

Just looking at what caused the problem in the first place. The problem happened because you formatted the drive and didn't copy over the contents of /usr to it. When you now boot the system it mounts the empty drive under /usr....so you no longer have /usr/bin, /usr/lib, /usr/local, /usr/sbin, /usr/share etc.


I would fix it the following way:

1) Boot into "diagnostic mode" or use a live CD like knoppix, just so that you can have access to your root file system.

2) To fix it so you can boot suse again edit /etc/fstab. You want to comment out the line with /usr in it. To comment out the line just put a # at the beginning. It should look something like:
#/dev/hdb1 /usr reiserfs defaults 1 1
You should now be able to reboot and get back into suse.

3) Create a temp mount point for it and mount it:
# mkdir /mnt/temp
# mount /dev/hdb1 /mnt/temp
I am guessing that /dev/hdb1 is correct. You may have to alter this to reflect your system, the correct device will be on the same line in /etc/fstab as /usr.

4) Copy over the entire contents of your /usr to the new drive:
# cp -r /usr/* /mnt/temp

5) Make a cup of tea, walk the dog or have a beer! ;)

6) Once copying has finished, mount the drive in the correct place and test:
# umount /mnt/temp
# mount /dev/hdb1 /usr
# ls /usr
You should be able to read the contents.

7) Uncomment that line from /etc/fstab so that the drive is mounted automatically when booting.


Report •

#3
July 20, 2005 at 05:06:46

Hi 3Dave,
thanks for your quick reply. Unfortunately it didn't seem to do anything, but at least I got no error message after typing the command. I rebooted by pressing Ctrl+D but it immediately came up with the same message... the file system is still read-only. By the way, even after typing my correct root password, the command line still begins with (none):~#
Is this right? I'm afraid I have little experience of command line Linux.
Tommy.

Report •

Related Solutions

#4
July 20, 2005 at 05:47:55

Hi 3Dave,
sorry, my reply above was to your first comment as I hadn't seen your second post. I removed the second hd, so I may reinstate it now and try all the above.I'll do that later today. Thanks for your advice.

Tommy.


Report •


Ask Question