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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
i backed up my main partition (mandriva) with partimage
and it's failing to restore. i just get the word 'GRUB'
flashing in endless columns across the screen.
i may get hda and sda mixed up in the following explanation
but that was not the case in the backup/restore process.
systemrescuecd called my primary disk sda and my notes
usually refer to hda. that's why.
what i did:
i used the gui for partimage to make a backup. that was
pretty straightforward, i thought.
to restore the image to sda (the MBR) instead of sda1.
Beyond that, it might be helpful to see the output of fdisk -l for the old and new disks, as well as the contents of /boot/grub/menu.lst (to compare menu stanzas with partition numbers as reported by fdisk).
Last edited by bigrigdriver; 03-05-2008 at 09:35 PM.
Use the "file" command to examine the filesytems:
sudo file -s /dev/sda
See if you can mount your root partition and if it is separate, the boot partition. Are you using a new kernel or the same kernel but a SATA drive?
If so, a device or file or the root entry listed as /dev/hdaX before may need to be listed as /dev/sdaX in the new one. Also make sure that the device order hasn't changed.
Look at the partimage backed up file. Is it an actual image, such as dd would create? "file -s image.000". I haven't used partimage before. dd ... | gzip works fine for me. But I would use tar for backups instead of an image backup. What happens if the image becomes damaged or the disk has a bad sector? (Actually, I prefer using dar/kdar to back up dvd sized slices)
Also look at your saved MBR. "file hdaboot.mbr". If you manually partitioned the new drive identically, you could restore only the first 244 bytes to prevent writing over the partition table.
dd if=hdaboot.mbr of=/dev/sda bs=244 count=1
If the partimage backup of /dev/hda1 is an image of the filesystem, you could at least mount the backup image (using loopback device) and copy files from it.
thanks homey. just tried it again with the bs and count on the
mbr restore. same thing: GRUB flashing in columns. i'm wondering
if there's maybe something wrong with the image. will try again
tomorrow with a new image.
one question, though. the drive i'm restoring to is of a different
size than the original. for that reason i'm being careful to
partition the partition in question to match the original. the
rest of the drive, however, is different:
Device Boot Start End Blocks Id System
/dev/hda1 * 1 454 3646723+ 83 Linux
/dev/hda2 455 2491 16362202+ 5 Extended
/dev/hda5 455 802 2795278+ 82 Linux swap / Solaris
/dev/hda6 803 2491 13566861 83 Linux
above is the fdisk table of the original drive. i've been
careful to keep hda1-5 matching this. hda6, however, which i
use as /home is sometimes different. it always has started at
the same block, 803, but the end is different depending on
what drive i'm trying to get this to work on. i was working
under the assumption that since i'm specifically restoring
hda1, it wouldn't much matter if hda6 was something different.
Yes, as far as /dev/hda1 is concerned. If you restore the mbr backup that you have, you will be writing over the partitioning that you created manually with fdisk.
Can you boot up with a rescue disk and enter its grub shell. From there see if you can find the kernel and initrd files. If so, enter the "kernel .." and "initrd " lines in the shell (use tab completion to make typing easier) and then enter the boot command. If it can boot up, then see if any values in /etc/boot/menu.lst need fixing, such as /dev/hda1 -> /dev/sda1. Then use the grub-install program to try to fix things.
If you want to hurry up and get something working on the new drive before the old one fails, I would use the clonezilla livecd to copy disk to disk.
Then worry about resizing the partitions after it's up and working.
The parted magic livecd is good for that part.
i have systemrescuecd. does that have the grub shell? how would i
do this? would i use that shell like bash or something to navigate
to my sda1 and find the kernel and initrd files? never been anywhere
near this deep into things so for give the dumb questions please.
mandriva seems to have a /initrd directory but the only thing in it
is a README.WARNING file. the file just says not to remove the
directpry as its needed for booting.
homey: i don't follow the clonezilla thing. i'd need a much more
step by step description to be able to pull that one off. will look
around for a guide but when i've looked at clonezilla before the
info i found all had a lot of chinese or such text attached and i
shyed away from it.
OK, hope I will not confuse you, but here's what I'd recommend.
Create a partition on your new HDD, at least as big as it was on old one, or bigger. Restore it from partimage image. Boot up with LiveCD, chroot into your Linux installation, install GRUB. Probably there is a script to do this (grub-install in Gentoo).