Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857
Rep:
boot the system to a linux rescue disk, like the RedHat install CD or maybe Tom's RTBT. Do not mount your good Linux install. Assuming your good Linux install is on /dev/hda and you want to copy to /dev/hdb ....
dd if=/dev/hda of=/dev/hdb
works best if hard drives have identical geometry.
yes, that works if the drives have the same geometry, but I find that they almost never do -- even if you buy, say, two Maxtor disks with what looks like the same name 6 weeks apart, the geometry is usually different.
There is a more generic (and also faster) procedure which I use in a different way to make an "image backup" of my systems (and also use for cloning purposes). There is an old post of mine at http://www.linuxquestions.org/questi...338#post295338
about this.
To go from disk to disk, make sure that the *new* disk is what it's gonna be later, such as /dev/hda. Your existing boot disk would be, say, /dev/hdc temporarily.
Then boot a rescue disk (in that post I have a pointer to one that I maintain that will do the trick, but the Redhat disk will suffice). Then, on the virgin /dev/hda make matching partitions as they are on your "good" boot disk. Be very careful not to confuse the disks... you can use fdisk and type the numbers, or use sfdisk -d to capture the partition info and make the other disk the same. Format the file systems on the new disk.
Then, mount each partition pair ( eg /dev/hda1 (=to) and /dev/hdc1 (=from) ), and cp -a or tar the contents from -> to.
Finally, end up with your later / partition mounted, in this example, as /to and run
lilo -r /to
(that's why it has to be what it will be later, e.g, /dev/hda )
The reason why this is faster in addition to geometry-independent is that with dd you copy each byte on the disk, even the unused ones. With that procedure, you copy only the actual files, which can be a lot less.
Distribution: Fedora, Debian, OpenSuSE and Android
Posts: 1,820
Rep:
I would check out Power Quests Drive Image program. It's not open source but it is the be-all-end-all of drive copy utilities. It handles different drive geometries well.
I have several partitions and want to move my linux on hda5 to hda12.
=====
1st: Copy the contents.
hda5 is about 20 GB, with only 1GB full.
hda12 is about 5 GB, completely empty.
I booted up with MORPHIX (like Knoppix, live-CD), mounted both drives and then did the following:
cp -a /mnt/hda5 /mnt/hda12
=====
2nd: modify LILO to boot off hda12.
change /etc/lilo.conf
root=/dev/hda12
Just wondering, will this work? Will there be any problems with hda12 thinking things need to be on hda5 (like do partitions know what they are?)? Is there something that will look like it worked but really didn't?
What I just described above worked, moving a distro from one partition to another.
The only problem I had was with LILO. I need to learn more about having more than one distro and how to handle the boot drive issue. (I have a boot partition on /dev/hda2).
yeah it should work well, you will just need some ajustement to your boot loader (or to completly reinstall the boot loader if you are moving to a new HD) but 'cept that, it should goes well.
Moving a *nix system is pretty easy... not like Windoze
If you could find the appropriate blocksize you could set count.
ie: dd if=/dev/hda of=/dev/hdb ibs=4096 count=250k
partition information will be wrong though.
So I moved my linux root from hda5 to hda12. My boot partition is on hda5.
While booted into hda5, I added the options into lilo with the
same boot image and two entries, the only difference is that one has root=/dev/hda12 and the other has root=/dev/hda5.
Here's the funky thing. Even when I load the /dev/hda12 one, /dev/hda5 gets mounted and set as root in the bootup.
My guess is that it is either:
1) Something on my boot partition that has a global reference to /dev/hda5.
2) Something in the bootup process (initd routines) has a global reference to /dev/hda5
I've got no clue how to figure this out though, so any help is appreciated.
==========
I am running Morphix (which may be part of the problem), but I'd be curious if this were something common to debian.
Has anyone moved their debian partition after install and not had to deal with something in the boot sequence deciding to mount the old drive?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.