LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-31-2014, 11:14 AM   #1
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Rep: Reputation: 0
Running the mount command in linux at run level 1


My install linux Centos 6.5, 64 bit system is now a read only install. I cannot write to it.

If I try to change it to a read write system using the command:

mount -o remount,rw /dev/hda2 /

(provided I have my root system as /dev/hda2)

it says : mount command not found. It says likewise for remount or umount.

So now I cannot change my hardrive from read only to read write. I am missing at whatever runlevel I am in.

I am root, however.

So my question is how can I change the linux install from read to read write if I am missing the mount, remount commands?

Can this be solved by linux rescue or chroot?

Those are the first two methods thta sprnig to mind.

Any help appreciated. Thanks in advance.

R,



jyunker
 
Old 10-31-2014, 11:50 AM   #2
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
You sure that it's not listed as /dev/sda2?
 
Old 10-31-2014, 12:00 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248
Quote:
My install linux Centos 6.5, 64 bit system is now a read only install. I cannot write to it.
Does that mean it had been working for some time and now you get this message? I doubt that CentOS 6.5 is going to show your drives as hd? rather than sd?. What changes did you make to the system just prior to this? Becoming read only geneerally happens with a problem with the filesystem and you need to run fsck on the system.
 
Old 10-31-2014, 02:42 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Very likely your path doesn't include /bin/mount...

Which usually indicates a problem with your shell environment.

Use mount with the full path.
 
Old 10-31-2014, 03:03 PM   #5
fatmac
Senior Member
 
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: BSD & Linux - As long as they are Lightweight
Posts: 1,500

Rep: Reputation: Disabled
If you can't mount your root filesystem, first try a fsck from the rescue console, then mount -a; failing that, use a 'live' system to take a look at your disk.
 
Old 11-03-2014, 09:07 AM   #6
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Original Poster
Rep: Reputation: 0
Getting out of emergency mode

Oaky, I see the problem now. I am in emergency mode in my Centos 6.5, 64 bit system, from what I have read emergency mode is like runlevel 1 except the system install is now read only.

One is very limited in the commands that he can give. I am looking for anything online that tells one how to get out of emergency mode.

So is there a step-by-step process to get out of emergency mode and into runlevel 1. I can take it from there.

Any help appreciated.

Thanks in advance.
 
Old 11-03-2014, 09:21 AM   #7
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I would just use the centos cd & chroot
 
Old 11-03-2014, 10:08 AM   #8
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Original Poster
Rep: Reputation: 0
Operating and getting out of emergency mode

I would love to use the Centos rescue CD/DVD. I am relieved that I finally found out
what run-level that I am in : emergency mode. I thougt is was in some bott purgatory.

At least that is a start. I need to repopulate the boot directory and the grub subdirectory.

I know in Ubuntu there is a program to do just this, is it compatible with Centos 6.5, 64 bit?

My guess is that it is not.


Respectfully,


jyunker
 
Old 11-03-2014, 11:31 AM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248
Quote:
My guess is that it is not.
Your guess is correct. Also, when I installed CentOS 6.5, it was still using Grub Legacy. switched to Grub2 with 7.0. What happened to your boot directory? You should be able to copy the necessary files from the installation medium of CentOS but you would need to modify the grub.conf/menu.lst file to suit your machine or else create a new one.
 
Old 11-03-2014, 02:04 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
(provided I have my root system as /dev/hda2)
Is this machine a dual-boot, if not you're mounting the wrong device. It should be /dev/sda1.
Can you run
Quote:
fdisk -l
And
Quote:
cat /etc/fstab

Last edited by EDDY1; 11-03-2014 at 02:06 PM.
 
Old 11-03-2014, 03:00 PM   #11
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Original Poster
Rep: Reputation: 0
running some basic commands

This all very new and that is why I am asking these questions.

My last command was

chroot /mnt/sysimage/

which generated no complaints.

Now I would love to run

fdisk -l and any other command.

However, I would like to run them on my /mnt/sysimage/ mounted install and I am not sure how to do that. Also I would like to run any other commands given above.

I just need to know where to do so and how.


Thanks in advance.


R,

jyunker
 
Old 11-03-2014, 03:31 PM   #12
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Original Poster
Rep: Reputation: 0
When I ran fdisk -l

I got

sh: fdisk command not found

and if I ran it again, I got the same thing.

Now when I ran

cat /etc/fstab

I got


#
# /etc/fstab
# Created by anaconda on Thu may 31, 12:55:35 2012
#
# accessible filesystem, by referernce, are manipulated under 'dev/disk'
# see man pages fstab(5), findfs(8), mount(8) and or bik(8) for more info
#
/dev/mapper/vg_james-lv_root / ext4 defaults 1 1
UUID=484051fe-2fd6-43d4-a752-71cd429969f5d /boot ext4 defaults 1 2
/dev/mapper_vg_james-lv_home /home ext4 defaults 1 2
/dev/mapper_vg_james-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tempfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0



This as best as I can copy it.


R,

jyunker
 
Old 11-03-2014, 03:36 PM   #13
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Are you mounting with live-cd?
What instructions are you following for /mnt/sysimage/?
Have you mounted proc, sys & dev
 
Old 11-03-2014, 04:00 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248
Changing to read only often happens with a corrupted filesystem and as suggested above, you could try running fsck on whichever partition it is. Why do you think you need to re-populate your boot and grub directories? Have you mounted your boot partition and the files are not there?
 
Old 11-03-2014, 04:58 PM   #15
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Original Poster
Rep: Reputation: 0
I boot up into Centos rescue. I am asked a set of questions about language and keyboard. It asks me if I want to start the network interfaces and I respond - no.

It gives a choice of rescue environments:

Continue Read-Only Skip Advanced

I select continue.

It says it is examining storage devices.


Then it says system has been mounted under
/mnt/sysimage


it also says the

Press return to get a shell. If you want to move your system the root environment, run the command:

chroot /mnt/sysimage.

I select ok.


It then says you system is mounted under the /mnt/sysimage directory. I acknowledge with ok.


It then gives a choice of three items:

shell Start shell
fakd run diagnostic
roboot Reboot


I select start shell and I get choose ok.

I get a shell prompt.

bash-4.1#

I can access my system at the command line. I cd /mnt/sysimage/

It is there - my system.

At this point I issue the command


chroot /mnt/sysimage/

(I assume that it is all that is required since that is all it says to do in the
boot up screens).


I issue the command and after a delay of 1 or 2 seconds it responds:
with a carriage return.

At this point it seems my entire file is now on the regular hard drive as I have known it.

I type (ls) at the coomand prompt and I get a listing of fles and directories.

The mnt directory is there. I cd into it and the sysimage is gone. Only the cdrom directory is there.

I type exit is it puts me back into graphical command mode.


I know that chroot usually has three bind commands (dev,run...). I did not use them.

The graphical interface only shows the one command.


chroot /mnt/sysimage/


I can use the LiveCD that I made, but it seems that simply using the Centos rescue option on the
on my centos 6.5, 64 bit install disk was easier.

I do not want to do anymore harm than necessary.

I have yet to make my Centos install read write from read only, but I will when I am sure of the commands.

I hope this shows acurrately where I am.

Any help appreciated.


R,

jyunker

I know that to run fsck one not mount files. So if I ran fsck i will not select continue

at the prompt and instead select skip.

Last edited by jyunker; 11-03-2014 at 05:01 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Ubuntu 11.10 on run level 3 tbaror Ubuntu 3 01-06-2012 02:27 PM
What happens f your linux system is at run level 5 and you use the command telenit 3? Beandip408 Linux - Newbie 5 10-16-2011 01:11 PM
How to enter graphical mode (run level 5) command line (run lenel 3) edmondgyampoh Linux - Newbie 3 05-15-2009 07:33 PM
not running in run level 5 anymore chars098 Linux - Newbie 2 10-29-2007 10:22 AM
How to mount in Run level 3 InEeDhElPlInUx Linux - Newbie 3 10-09-2003 11:59 PM


All times are GMT -5. The time now is 10:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration