Mandriva Linux Archives: expert@mandrivalinux.org
Mandriva Linux: expert@mandrivalinux.org
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- From: Bill Mullen
- Subject: Re: [Expert] Duplicating a drive
- Date: 31 Jul 2006 15:05:16 -0000
On Mon, 31 Jul 2006 12:40:09 +0200, JPB wrote: > Le Lundi 31 Juillet 2006 02:39, Bill Mullen a écrit : > > On Sun, 30 Jul 2006 14:40:06 -0600, D. R. Evans wrote: > > > I am getting SMART errors from a drive, so I want to do the > > > following: > > > > > > 1. Install a larger drive as hdb > > > 2. Duplicate hda (which is running Mandrake 9.2) on to hdb > > > 3. Take out hda (and throw it away) and move the drive that was > > > hdb into the hda slot. > > > 4. Boot and have *everything* work as if I had done nothing. > > > > > > Is there a way to do step 2? > > > > > > And for bonus points: what is that way? :-) > > > > > > As you can probably imagine, there's some urgency to this. > > > Installing brand new (more recent) OS on this machine is not very > > > feasible, because duplicating the behaviour (configuration, etc.) > > > of all the software would cause a lot more downtime; so I can do > > > that only if there is no way to perform the steps described above. > > > > Sure, it's doable; all you'll need, besides the new drive, is > > whichever LiveCD version of Linux is your favorite and will boot on > > that box. You could even do it with a MDK/V Install CD #1 booted to > > the rescue system, if that's all you have handy - even the 9.2 one > > would be fine for this. If it were me doing it, a MDK/V rescue > > system is exactly what I'd use; boots fast, no bloat, has what few > > commands we need for that stage. > > > > Okay, let's take this from the top. > > > > 0) Ignore paul's advice about using dd - you're right, it's not that > > easy. If the two drives were of identical sizes *and* you did it > > from a LiveCD, it'd probably work ... but they're not, so that > > way's out. > > > ----------sniped----------- > > HTH! > > Hum; I beg to differ; the dd command is working pretty well for that, > even if the drives are of different size (provided the target drive > is bigger); I did that several times without any problem. > The only glitches are 1/ you have some spare space at the end of the > new drive; and 2/ if you boot with both drives in the machine you > have a harmless warning about something like "duplicate disk ID". > > Usually with MDV auto-partinionning /home is the last filesystem on > the disk so it very easy to log in as root, tar the /home filesystem, > unmount it then suppress the partition, recreate it with a bigger > size mount and untar. > > Nota: dd perform a physical copy (sectors) and even empty sectors are > copyied so it may take a long time to do the copy. > I would change D.R.Evans command by adding a big bs size otherwise it > may take forever to finish. > dd if=/dev/hda of=/dev/hdb conv=noerror,sync bs=1M > I have to admit I did that several times without the conv= parameter; > will look at the man for that. I would agree with that assessment, but: 1) We don't know that he used auto-partitioning when he installed MDK 9.2, and therefore also do not know whether or not /home is, in fact, in the last partition on the current drive (it isn't on any of my systems, for example, because I never use auto-partitioning); 2) We also don't know if he even has space available anywhere to put the tar file to which you refer while the partition is being deleted and recreated (bear in mind, this file could well be extremely large); 3) If /home is not his only logical partition, then AIUI all other logical partitions would also have to be tarred up and the tar files stored somewhere, and then those partitions would also need to be re-created, because the (invisible, except within certain apps such as fdisk) primary partition which *contains* those logical ones - the "extended" partition - is what actually needs to be remade in order to fully utilize the remainder of the free space on the new drive; 4) Since the difference in sizes between the old drive and the new one could easily be 100G or more, just leaving whatever extra space there might be on the new drive wholly inaccessible is extremely unlikely to be an attractive option, IMHO; 5) He would not have the opportunity to adjust the sizes of his other partitions, which my method provides; since many Linux users find that their initial partition size decisions prove to be less than optimal once they have been using the system a while (including those that were made by the installer's auto-partitioning) - and, given that his system is running MDK 9.2, we can safely say he's been running it for a fairly long time - this is IMHO a significant drawback of the dd method; 6) Since, as you say, the dd method takes a long time to complete due to the copying of every sector on the source drive, my method is unlikely to be more time-consuming, and in fact could turn out to be considerably quicker; it took a lot longer to write it up than it would to do it. All things considered, and jumping to as few conclusions as possible about both his current setup and that which he wants to have on the new drive, I remain convinced that the procedure that I outlined is more likely to give him - and most others who find themselves in the same situation - the most satisfying results. -- Bill Mullen RLU #270075
- References:
- [Expert] Duplicating a drive
- From: D. R. Evans
- Re: [Expert] Duplicating a drive
- From: Bill Mullen
- Re: [Expert] Duplicating a drive
- From: JPB
- [Expert] Duplicating a drive
- Prev by Date: Re: [Expert] Where is my 2TB limitation?
- Next by Date: Re: [Expert] Duplicating a drive
- Previous by thread: Re: [Expert] Duplicating a drive
- Next by thread: Re: [Expert] Duplicating a drive
- Index(es):
