[SOLVED] Moving install to new hard drive (Fc12) Understanding mount, grub.conf, and rsync
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.
Moving install to new hard drive (Fc12) Understanding mount, grub.conf, and rsync
Dear friends,
As my proficiency with Linux improves slowly, I've been trying to find the answers for myself, but in this situation I must admit I find myself rather stumped. I have a perfectly nicely working Fedora 12 install on an 80GB SATA drive, and when it hit an error and wouldn't boot last week (easily fixed with fsck from the initial command line) I panicked and ordered a new 250 GB drive. It got here and I might as well use it, I thought to myself, so I went about trying to figure out how to move my install without having to reset all of my settings, programs and so on. I didn't want to mess with dd because I'm not so so clear on resizing my partitions once the copy is done (if someone thinks this is a better idea I'm open to suggestions.) After some poking around I found this set of instructions which I attempted to follow to the letter, but hit some snags. I understand this thread I am referring to may be a bit outdated, which is why (I assume) I hit a bump here
Code:
# mount /dev/hdy1 /boot
mount returns an error demanding I specify the file system type. At a loss, I barreled on until
Code:
# rpm -ivh --force kernel-version.rpm
whereupon rpm told me I could only force certain things, the kernel version not being one of them. At this point I was really lost, as I was unsure of how to edit Grub.conf . Attempting to run
Code:
Grub-install /dev/sda1
(Yes, the NEW hard drive is showing up as sda, don't ask me why) from a Fedora live CD returned an error message as well.
To summarize, I partitioned and mounted my new drive using fdfisk and the instructions provided above, then used rsync to copy over all of the files, so as far as I know the new drive is ready to go, just not yet bootable. Opening the Grub.conf file in Kwrite (as root) returns a blank page. What do I do now?
As a side note, you can see that I am not too squeamish about the terminal, so I would prefer to find a "command line only" solution to this relatively simple (?) procedure. As always, thanks very much in advance for your time and attention.
First, the author of the article you referred to used hdx and hdy to represent the first and second drives. X and y are variables which you must edit to substitute the actual drive letters for your system. Example: let's say you have two drives hda and sda; not hdx and hdy.
Second, running "grub-install /dev/sda1" would write the first stage of grub, and the partition table, into the first partition of sda instead of into the MBR of the drive.
You may have to copy it all over again, then run "grub-install /dev/sda" (note that the partition number is not given in the command".
Or, even though you are uncomfortable about using dd, the command "dd of=/dev/hda if=/dev/sda" would copy all of hda to sda (assuming your drives are hda and sda), including the MBR. Afterward, you could use gparted to edit the partition(s) to your liking: resize, make new partitions, etc.
You would then need to edit your BIOS to probe /dev/sda (the new drive) first for a bootable OS,
before probing the old drive.
It would be helpful if you show us the output of "fdisk -l" so that we can see the disks and partitions you have now, as seen by your system.
Last edited by bigrigdriver; 05-31-2010 at 05:37 PM.
First, the author of the article you referred to used hdx and hdy to represent the first and second drives. X and y are variables which you must edit to substitute the actual drive letters for your system. Example: let's say you have two drives hda and sda; not hdx and hdy.
I understood this, I just cut and pasted from the source article but the actual commands I issued referred to sda (the new 250 GiB drive) and sdb (the original). Thank you for catching that.
Quote:
Originally Posted by bigrigdriver
Second, running "grub-install /dev/sda1" would write the first stage of grub, and the partition table, into the first partition of sda instead of into the MBR of the drive.
Come to think of it, I'm pretty sure I typed /dev/sda, understanding this command applied to the entire disk. I'm sorry for being misleading with my earlier post. I will try again, just in case I'm wrong here.
Quote:
Originally Posted by bigrigdriver
Or, even though you are uncomfortable about using dd, the command "dd of=/dev/hda if=/dev/sda" would copy all of hda to sda (assuming your drives are hda and sda), including the MBR. Afterward, you could use gparted to edit the partition(s) to your liking: resize, make new partitions, etc.
As I said, I'm not opposed to that solution as long as I can resize the partitions easily using the command line. What tool would I use here? Fdisk?
Quote:
Originally Posted by bigrigdriver
It would be helpful if you show us the output of "fdisk -l" so that we can see the disks and partitions you have now, as seen by your system.
Code:
[root@0080deathscythe ~]# fdisk -l
Disk /dev/sdb: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x41ab2316
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 26 9726 77919263+ 8e Linux LVM
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000803c9
Device Boot Start End Blocks Id System
/dev/sda1 1 39 313236 83 Linux
/dev/sda2 40 30401 243882765 83 Linux
Disk /dev/dm-0: 75.8 GB, 75828822016 bytes
255 heads, 63 sectors/track, 9218 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 3959 MB, 3959422976 bytes
255 heads, 63 sectors/track, 481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-2 doesn't contain a valid partition table
Disk /dev/dm-3: 243.3 GB, 243290603520 bytes
255 heads, 63 sectors/track, 29578 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-3 doesn't contain a valid partition table
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe8900690
Device Boot Start End Blocks Id System
/dev/sdc1 1 121601 976760001 7 HPFS/NTFS
Disk /dev/sdd: 4005 MB, 4005560320 bytes
21 heads, 21 sectors/track, 17740 cylinders
Units = cylinders of 441 * 512 = 225792 bytes
Disk identifier: 0xe89
Where sda is the target drive, sdb the source, sdc is an external HDD and sdd is a flash drive. Thanks again for your prompt reply.
why not using parted instead of dd?
it has an interactive mode ( -i flag) and can beside creating, formating and labeling partitions also copy the contend of one device / partition to another. not sure in how far the size have to be the same.
Thanks for all of your help, guys. I would like to remind everyone reading this thread that dd is a very easy command to make critical mistakes with: I transposed "if" and "of" and now this is all a moot point. Starting over again with f13. I know you guys warned me, I don't know how I did it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.