Linux: Moving out...
My new disk had been lying around for, well, at least two weeks. I just couldn't find the strength or the desire to copy my system on it. I thought it would be boring to death... In text mode with nothing much to do but watch the wonderful animations of 'htop'... I was wrong!
It was a nightmare! Now, I hate GRUB. It's totally abstruse. Its mini-CLI is a joke, its help doesn't help anybody. Sorry, but I have to put the blame on something else than my own stupidity that played --maybe-- the main role in this nightmare. ;-)
Any way, here's how it moved out: I switched to runlevel 3 so that nothing messes with me with opened files, lock files, whatever, all over the partitions. I mounted the freshly partitionned new disk and copied everything, folder by folder with 'cp -dpR /this /over/there'. I did it this way in order to still have something to do instead of waiting forever that 'cp' finishes its job with absolutely nothing to do. 'htop' has very limited animation capabilities. ;-)
That was the fastest part. Then I tried with YaST to install a new boot loader. Shutdown. I removed the old disk and plugged the new one. Re-boot and...
GRUB
Keyboard dead. Nothing else to do but press the reset button. Oh... Happiness...
I re-booted in rescue mode with the first CD of my SuSE. I intended to let GRUB install itself. I'm used to the abstruse UNIX tools but GRUB is the champion in this category. How I am supposed to guess that the partitions are labelled "(hdX,Y)" if GRUB doesn't say it anywhere, not even in its manpage... which is inaccessible any way because 'man' isn't available in rescue mode. Maybe in the infopages... but that's definitely not a reflex by me.
I simply wasn't able to do anything with GRUB! Period.
Shutdown. Switch the disks. Re-boot. Google!
Ha! (hd0,4) is my /boot partition.
Shutdown. Switch the disks. Re-boot. Rescue mode.
'grub'... What are those "stage1", "stage2" and "stage1.5"?
Shutdown. Switch the disks. Re-boot. Google!
'grub-install --root-directory=/boot /dev/hda' said Google. This time, I didn't come back empty-handed.
Shutdown. Switch the disks. Re-boot. Rescue mode.
'grub-install...' Are you doing anything? Yes? No? Maybe? CTRL+C!
'grub'
GRUB>
Back to square one! Tried this... Tried that... "Succeeded" said GRUB.
Shutdown. Re-boot.
GRUB
Keyboard dead. Reset. Re-boot. Rescue mode.
'grub'
GRUB>
Looked like familiar... I was almost feeling at home. Tried this... Tried that... "Succeeded" said GRUB... but I wouldn't believe if it told me that the sky is blue.
Shutdown. Re-boot.
Miracle! It ran... in text mode. "/blah/blah/message" not found. Not good... And effectively. No boot possible. Partition not found.
GRUB>
Shutdown. Re-boot. Rescue mode.
'joe /mnt/grub/menu.lst' (Where is Nano or Pico when you need it?)
All this was a bit my fault. I didn't pay attention to the fact that on my old disk the swap partition was the first while I put it in second on the new disk.
Shutdown. Re-boot.
Second miracle! It ran in graphic mode. It even booted! Until...
"fsck failed" and needed to be run manually on a partition (not root).
I fsck'ed almost everything. No error. WTF?
'pico /etc/fstab'
My bad! If GRUB doesn't like to find unexpected things on the partitions, 'fsck' is even stricter! So, I swapped two lines. /boot is hda5 and swap is hda6.
Shutdown. Re-boot.
Nobody complained any more. I reached the login and... Oh boy! The xdm login screen made my eyes bleed.
No KDE, not even Gnome, no nothing! /opt is empty! Cold sweat... Didn't I copy it? Yes, I did! I could remember it! WTF?
'init 3 ; pico /etc/fstab'
Before this new disk, I already added a new disk, move /home onto it and moved /opt on the partition where /home was. That's what "fstab" said... But what it did was to mount a now empty partition over the definitively not empty /opt.
I banged my head against a few walls. ;-) I corrected my mistake... and another less important one, copied the partition I forgot.
'init 5'
The new disk is hanging out of the case on a little carton box, the old disk is plugged where the CD-ROM usually is. Whatever? It works!
Next time, I'll know what to pay attention at and the remedy to all the possible errors. And if I ever forget, this blog will be here to remind me.
I've moved out. :-D
1 Comments:
I completely agree - GRUB is awful if you have to troubleshoot it, or do anything other than just select a boot option from a menu. I'm surprised that nobody seems to have forked it or written a more friendly one from scratch (well, as far as I am aware anyway).
Post a Comment
<< Home