Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
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
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:
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).
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!
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?
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?
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/sda3rmdir /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)
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.