LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 02-02-2008, 10:10 AM   #16
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116

When it dumps you to a shell (aka console) as root, it is telling you "here you are, now you can fix me." You need to do your work from the command line.

Follow tredegar's instructions.
 
Old 02-04-2008, 11:55 AM   #17
UTKEngineer
Member
 
Registered: Jul 2003
Location: Tx, USA
Distribution: FC 7-64
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
Oooops! What have you done?

Just copying files to /data should not have done this!
There is a problem in your fstab where it is trying to fsck your data partition, but it cannot find it.


Can you use this shell? (If not, you'll have to boot from a rescue CD)
Can you see or mount your root partition (/dev/hda1)?
The outputs from
mount
fdisk -l

would be useful to know

Edit your /etc/fstab file on /dev/hda1 so the line referring to 'LABEL=/data' refers to /dev/hda2 instead of the LABEL=/data. Then reboot.

If this is difficult, instead of editing fstab post it here, along with the output of fdisk -l and we'll see what can be done.
I appreciate the continued help. I assume that it wasn't the copying that caused this error but a mistake made when formatting my /data partition. That same error may have been why the copy didn't work.

In any event, the shell seems to have functionality. Here are the outputs you asked for:

mount:
/dev/sda2 on / type ext3 (rw)
proc on /proc type ext (rw)


I should point out, /dev/sda1 is my boot partition, /dev/sda2 is my / partition, and /dev/sda3 is my /data partition.

fdisk -l:

Disk /dev/sda: 250GB
(ignoring byte and cylinder info)

Device Boot Start End ID System
/dev/sda1 * 1 13 83 Linux
/dev/sda2 14 1318 83 Linux
/dev/sda3 1319 30388 83 Linux
/dev/sda4 30389 30401 5 Extended
/dev/sda5 30389 30401 82 Linux Swap




I tried to edit the fstab but got an error that it was read only. How do I open it with editing privileges? I tried info vi but it seemed like it should open read/write by default.

Again, I really appreciate your help.
 
Old 02-04-2008, 12:38 PM   #18
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
OK, we are making some progress.
Quote:
I assume that it wasn't the copying that caused this error but a mistake made when formatting my /data partition.
I am a little confused
Have you formatted your data partition ( /dev/sda3 )?
When did you format it?
How did you format it? (Eg ext2 or ext3 or whatever)
Do you remember the exact command you used to format it?

Once formatted, you need to mount your /data partition.
You can either do this manually like this (as root)

Code:
mkdir  /data
chmod  777  /data
mount  -t  ext3  /dev/sda3  /data
Or by editing your /etc/fstab
If you post your /etc/fstab, we can probably tell you what needs changing.

Quote:
I tried to edit the fstab but got an error that it was read only.
You need to become root to save changes to fstab so do that, then vi /etc/fstab if you can use vi, or maybe nano /etc/fstab if vi is too awful to contemplate ( I quite like it! )

[nano has a little help screen at the bottom of the editing page]

BUT mounting your /dev/sda3 is the least of your problems: You are dropped to a shell, why isn't your GUI working (and was it KDE or gnome, or something else)?
We need to know exactly what you did that broke your system, so maybe we can work out how to repair it.

Last edited by tredegar; 02-04-2008 at 12:39 PM. Reason: Spelling
 
Old 02-04-2008, 12:56 PM   #19
UTKEngineer
Member
 
Registered: Jul 2003
Location: Tx, USA
Distribution: FC 7-64
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
OK, we are making some progress.

I am a little confused
Have you formatted your data partition ( /dev/sda3 )?
When did you format it?
How did you format it? (Eg ext2 or ext3 or whatever)
Do you remember the exact command you used to format it?
I was following jailbait's directions on moving /usr. I formatted w/:

Code:
mkfs -t ext3 /dev/sda3
Quote:
Originally Posted by tredegar View Post
Or by editing your /etc/fstab
If you post your /etc/fstab, we can probably tell you what needs changing.
I booted a live cd and edited my fstab from there. Since the error was showing a failure on /data, I thought removing all reference to /data from my fstab would get me booted into a GUI, but it didn't. After returning my fstab to it's original state, it looks like this:
Code:
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
LABEL=/data             /data                   ext3    defaults        1 3
tmpfs                   /dev/shm                tmpfs   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
LABEL=SWAP-sda5         swap                    swap    defaults        0 0

Quote:
Originally Posted by tredegar View Post
We need to know exactly what you did that broke your system, so maybe we can work out how to repair it.
I'm still wondering that. Honestly, I was just following jailbait's suggestions. Albeit, I stupidly did it from a console running in a gui. For some reason my mind saw single user and thought super user (su).
 
Old 02-04-2008, 01:36 PM   #20
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I was following jailbait's directions on moving /usr. I formatted w/:
mkfs -t ext3 /dev/sda3
jailbait's instructions refer to /dev/hda2 when it seems they should have been referring to /dev/sda3

I hope you haven't accidentally formatted your / partition! Easy to do when you are both translating hda => sda and 2 => 3
Not sure if anything would work at all if you did this (but you do have your kernel in /boot, so maybe some bare-bones functionality?)
Please take a look around in / do you see the usual directories, subdirectories and files? If you are not used to poking around in the linux filesystem, maybe this is not a helpful suggestion. Sorry

As you were using the GUI (BAD idea) for your "copy", I wonder if you made a mis-click and chose "move" instead. That might explain things. Do the contents of /usr look "OK" ?
If you have moved /usr to /data rather than copied it, and now reformatted /data, there is serious trouble ahead.

I have a bad feeling about all this
jiml8, jailbait, where are you all? Help is needed here!
 
Old 02-04-2008, 01:52 PM   #21
UTKEngineer
Member
 
Registered: Jul 2003
Location: Tx, USA
Distribution: FC 7-64
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
jailbait's instructions refer to /dev/hda2 when it seems they should have been referring to /dev/sda3

I hope you haven't accidentally formatted your / partition! Easy to do when you are both translating hda => sda and 2 => 3
Not sure if anything would work at all if you did this (but you do have your kernel in /boot, so maybe some bare-bones functionality?)
Please take a look around in / do you see the usual directories, subdirectories and files? If you are not used to poking around in the linux filesystem, maybe this is not a helpful suggestion. Sorry

As you were using the GUI (BAD idea) for your "copy", I wonder if you made a mis-click and chose "move" instead. That might explain things. Do the contents of /usr look "OK" ?
If you have moved /usr to /data rather than copied it, and now reformatted /data, there is serious trouble ahead.

I have a bad feeling about all this
jiml8, jailbait, where are you all? Help is needed here!
I think they've all abandoned me as hopeless.

As for your concerns, I have already checked and my / partition still has all the stuff it should on it.

Am I correct in assuming that if I remove the "LABEL=/data...." line from my fstab that it should simply ignore /dev/sda3 and not try to mount it?
 
Old 02-04-2008, 02:03 PM   #22
UTKEngineer
Member
 
Registered: Jul 2003
Location: Tx, USA
Distribution: FC 7-64
Posts: 37

Original Poster
Rep: Reputation: 15
Ok - I again booted with a live cd and edited my fstab so it no longer pointed to /data or /dev/sda3 and my system booted w/o a problem. So, light at the end of the tunnel?

So, I guess now I'm back to my original problem with a new quirk. How do I create move my /usr folder to /dev/sda3 (since /data no longer exists).

And let me clarify, I've printed the thread out, so I've got everyone's instructions, but don't know how to get a console w/o booting to the gui. So, how do I get a console?
 
Old 02-05-2008, 03:05 AM   #23
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I again booted with a live cd and edited my fstab so it no longer pointed to /data or /dev/sda3 and my system booted w/o a problem. So, light at the end of the tunnel?
Excellent

Quote:
So, how do I get a console?
Boot
Wait for desktop to appear. Do not bother to login. Press
<CTRL><ALT><F1> (Same as you'd do a <CTRL><ALT><Del> )
You get a terminal login. No GUI
Login as root, if you are able to, otherwise login as yourself and sudo -i
to get a root shell.
Go to single user mode:
Code:
init 1
^ That's "init one" not "init Ell"

Mount your /dev/sda3 :
Code:
mkdir /sda3
mount  -t  ext3  /dev/sda3  /sda3
Copy all of /usr to /sda3 We'll use a tar pipe, as this is guaranteed to do it properly (thanks for that reminder forrest):
Code:
cd /usr
tar  -cvf  -  .  |  (  cd  /sda3  ;  tar  -xvf  - )
Add an extra file to /sda3 :
Code:
touch  /sda3/I_am_on_sda3
Edit your fstab so it'll mount /dev/sda3 to /usr at boot time by adding this line:
Code:
/dev/sda3    /usr   ext3  defaults  1 3 
Tidy up:
Code:
umount /dev/sda3
rmdir /sda3
Reboot:

Code:
shutdown -r now
When the system comes back up, login normally
Take a look in /usr
There should be a file called I_am_on_sda3 (which you can now safely delete, or leave, as you see fit)
 
Old 02-05-2008, 10:29 AM   #24
UTKEngineer
Member
 
Registered: Jul 2003
Location: Tx, USA
Distribution: FC 7-64
Posts: 37

Original Poster
Rep: Reputation: 15
Tredegar,

You, sir, are awesome!

I'm back up and running with /usr on sda3. I can't thank you enough!!!!

If I ever make it to London, I owe you a beer!
 
Old 02-05-2008, 04:06 PM   #25
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
I think I've finally worked out what went wrong. When you reformatted your /data disk, it was given a new label, or maybe a null label, anyway it was labelled as something that was not "/data" so whatever reads fstab could not find it, so the boot process (stupidly?) failed. It could have ignored the error, and put a message like "fstab error: Can't find a disk labelled "/data" so not mounting it but continuing." into /var/log/messages
But it didn't.

As it was it dropped you to a (functioning) shell - so in the end, all was well.

Newer distros like to refer to disks by label, not physical connection (ie /dev/[s|h]da[number] ). With the increasing use of (un)pluggable devices, I can see the need for this, but in your case, it broke. Quite badly, but it was recoverable.

If you had reformatted your /data disk as:
Code:
mke2fs  -t  ext3  -L  /data  -j  /dev/sda3
then you would have ended up with an ext3 disk labelled correctly, and it would have mounted correctly. The sad thing is that you did not need to reformat that disk, but just delete everything from it before you copied /usr over to it.

Such is life.

The (small) downside of what you have done is that if you move the physical connection (Cable connections, Master/Slave) of your /dev/sda3 your system will break again. But now I think you now know enough to recognise the problem and get it functioning again


Thanks for the "thanks" - it's appreciated.
Make mine a pint of Sam Smith's, at room temperature
 
Old 02-08-2008, 01:15 PM   #26
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I have been preoccupied with a fire drill for a few days (some real-time C coding that had to be done like yesterday, but was only given to me today...and without the documentation for the hardware!) and I failed to notice that there were more posts on this thread.

In any event, all is well that ends well, and my last instructions on the thread (follow tredegar's instructions) were the right ones.
 
  


Reply



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
How do you change partition order from say hda2 to hda1, where hda1 does not exist r00tb33r Linux - Software 6 04-09-2007 11:33 PM
If hda1 is (0,0), What Are hda2, hda5, and hda6? rrrssssss Linux - General 2 01-21-2007 04:51 AM
Linux root moved from hda2 to hda1 dangerousdave Linux - Software 3 11-02-2005 06:18 PM
Can mount hda1, but not hda2,3,4,5, or 6? Dobie Linux - Newbie 4 06-13-2004 04:37 PM
mount filesystems from hda1 and hda2 jhirshon Linux - Newbie 3 01-29-2004 12:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:51 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
Open Source Consulting | Domain Registration