public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] dd'ing small drive to large one
@ 2011-01-31 17:34 Alex Schuster
  2011-01-31 18:19 ` Allan Gottlieb
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Schuster @ 2011-01-31 17:34 UTC (permalink / raw
  To: gentoo-user

Hi there!

There is a PC with a 160 GB SATA drive, and I want to replace it with one of 
about 1 TB in size. Would this work?

- attach 2nd drive via SATA port or USB->SATA convertor
- boot from rescue CD
- dd if=/dev/sda of=/dev/sdb
- remove sda, attach sdb to where sda was
- reboot
- add other partitions or enlarge the last one

I do not expect problems, but I'm not entirely sure. Maybe the different 
drive geometry would have an effect on file system or at least to the Grub 
boot loader?

The system is remote, so I will not do the exchange personally. I will only 
make the additional space usable once the system is back up and running. The 
person who does the replacement does not know too much about LVM and file 
systems, and how to make a Gentoo system work again if the boot partition 
got corrupted. He will use Norton Ghost to duplicate the drive's contents. I 
would prefer dd, but the person is a Windows guy, and Ghost will probably do 
the job as well.

	Wonko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 17:34 [gentoo-user] dd'ing small drive to large one Alex Schuster
@ 2011-01-31 18:19 ` Allan Gottlieb
  2011-01-31 18:36   ` Alex Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Allan Gottlieb @ 2011-01-31 18:19 UTC (permalink / raw
  To: gentoo-user

On Mon, Jan 31 2011, Alex Schuster wrote:

> Hi there!
>
> There is a PC with a 160 GB SATA drive, and I want to replace it with one of 
> about 1 TB in size. Would this work?
>
> - attach 2nd drive via SATA port or USB->SATA convertor
> - boot from rescue CD
> - dd if=/dev/sda of=/dev/sdb
> - remove sda, attach sdb to where sda was
> - reboot
> - add other partitions or enlarge the last one
>
> I do not expect problems, but I'm not entirely sure. Maybe the different 
> drive geometry would have an effect on file system or at least to the Grub 
> boot loader?

Won't dd'ing the whole disk will make the 1TB disk a 160GB disk.

I would partition the TB disk as you like and
do a tar or rsync on each partition of the original.

Some care would be needed for /dev and I don't think things like /proc
should be copied.

allan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 18:19 ` Allan Gottlieb
@ 2011-01-31 18:36   ` Alex Schuster
  2011-01-31 19:16     ` Allan Gottlieb
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Schuster @ 2011-01-31 18:36 UTC (permalink / raw
  To: gentoo-user

Allan Gottlieb writes:

> On Mon, Jan 31 2011, Alex Schuster wrote:

> > There is a PC with a 160 GB SATA drive, and I want to replace it with
> > one of about 1 TB in size. Would this work?
> > 
> > - attach 2nd drive via SATA port or USB->SATA convertor
> > - boot from rescue CD
> > - dd if=/dev/sda of=/dev/sdb
> > - remove sda, attach sdb to where sda was
> > - reboot
> > - add other partitions or enlarge the last one
> > 
> > I do not expect problems, but I'm not entirely sure. Maybe the
> > different drive geometry would have an effect on file system or at
> > least to the Grub boot loader?
> 
> Won't dd'ing the whole disk will make the 1TB disk a 160GB disk.

Not really. Yes, the current partitioning scheme will not make more than the 
160G available. But this can be changed easily later, all I need to do is 
call fdisk and add partitions. Or resize the last one.

> I would partition the TB disk as you like and
> do a tar or rsync on each partition of the original.
> 
> Some care would be needed for /dev and I don't think things like /proc
> should be copied.

But that's much more complicated than just using dd or Ghost. It involves 
using a Linux rescue CD, mounting several file systems, using the right 
cp/tar/rsync syntax, and installing a new boot loader. With me telling the 
guy via phone what he has to type.
If it's really necessary, oh well, than it has to be done. But if dd'ing the 
drive would work, I would vermy much prefer this.

	Wonko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 18:36   ` Alex Schuster
@ 2011-01-31 19:16     ` Allan Gottlieb
  2011-01-31 20:34       ` Alan McKinnon
       [not found]       ` <4D472323.6050007@wonkology.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Allan Gottlieb @ 2011-01-31 19:16 UTC (permalink / raw
  To: gentoo-user

On Mon, Jan 31 2011, Alex Schuster wrote:

> Allan Gottlieb writes:
>
>> On Mon, Jan 31 2011, Alex Schuster wrote:
>
>> > There is a PC with a 160 GB SATA drive, and I want to replace it with
>> > one of about 1 TB in size. Would this work?
>> > 
>> > - attach 2nd drive via SATA port or USB->SATA convertor
>> > - boot from rescue CD
>> > - dd if=/dev/sda of=/dev/sdb
>> > - remove sda, attach sdb to where sda was
>> > - reboot
>> > - add other partitions or enlarge the last one
>> > 
>> > I do not expect problems, but I'm not entirely sure. Maybe the
>> > different drive geometry would have an effect on file system or at
>> > least to the Grub boot loader?
>> 
>> Won't dd'ing the whole disk will make the 1TB disk a 160GB disk.
>
> Not really. Yes, the current partitioning scheme will not make more than the 
> 160G available. But this can be changed easily later, all I need to do is 
> call fdisk and add partitions. Or resize the last one.

Sure, but the other partitions will stay the same size.  If you are
using lvm then that is no problem, if not I would think it is
constraining.

allan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 19:16     ` Allan Gottlieb
@ 2011-01-31 20:34       ` Alan McKinnon
       [not found]       ` <4D472323.6050007@wonkology.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Alan McKinnon @ 2011-01-31 20:34 UTC (permalink / raw
  To: gentoo-user; +Cc: Allan Gottlieb

Apparently, though unproven, at 21:16 on Monday 31 January 2011, Allan 
Gottlieb did opine thusly:

> On Mon, Jan 31 2011, Alex Schuster wrote:
> > Allan Gottlieb writes:
> >> On Mon, Jan 31 2011, Alex Schuster wrote:
> >> > There is a PC with a 160 GB SATA drive, and I want to replace it with
> >> > one of about 1 TB in size. Would this work?
> >> > 
> >> > - attach 2nd drive via SATA port or USB->SATA convertor
> >> > - boot from rescue CD
> >> > - dd if=/dev/sda of=/dev/sdb
> >> > - remove sda, attach sdb to where sda was
> >> > - reboot
> >> > - add other partitions or enlarge the last one
> >> > 
> >> > I do not expect problems, but I'm not entirely sure. Maybe the
> >> > different drive geometry would have an effect on file system or at
> >> > least to the Grub boot loader?
> >> 
> >> Won't dd'ing the whole disk will make the 1TB disk a 160GB disk.
> > 
> > Not really. Yes, the current partitioning scheme will not make more than
> > the 160G available. But this can be changed easily later, all I need to
> > do is call fdisk and add partitions. Or resize the last one.
> 
> Sure, but the other partitions will stay the same size.  If you are
> using lvm then that is no problem, if not I would think it is
> constraining.

The pertinent question is what is on those partitions from the first to second 
last? Maybe they don't need to be any bigger than the original disk.

/opt, /boot, /usr, %PORTDIR come to mind as likely candidates. Maybe the OP 
can live with that constraint.


-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
       [not found]       ` <4D472323.6050007@wonkology.org>
@ 2011-01-31 21:19         ` Alex Schuster
  2011-01-31 22:37           ` Nils Holland
                             ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Alex Schuster @ 2011-01-31 21:19 UTC (permalink / raw
  To: gentoo-user

I just wrote:

> My only fear is that the different drive geometry will be a problem, so
> Grub does not find its stage2 in /boot, or file systems will unreadable
> due to things being specified as head, cylinder and sector, instead of
> absolute blocks. I'm pretty confident that there should be no problem,
> but if I am wrong, I will be in trouble.

Now I'm really really sure there will be no problem. What I wrote above
about the gemotry is true I think, but all modern drives seem to have
255 heads and 63 sectors per track, so they will be compatible.

	Wonko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 21:19         ` Alex Schuster
@ 2011-01-31 22:37           ` Nils Holland
  2011-01-31 22:39           ` Mick
  2011-01-31 22:57           ` Iain Buchanan
  2 siblings, 0 replies; 12+ messages in thread
From: Nils Holland @ 2011-01-31 22:37 UTC (permalink / raw
  To: gentoo-user

On 22:19 Mon 31 Jan     , Alex Schuster wrote:
> I just wrote:
> 
> > My only fear is that the different drive geometry will be a problem, so
> > Grub does not find its stage2 in /boot, or file systems will unreadable
> > due to things being specified as head, cylinder and sector, instead of
> > absolute blocks. I'm pretty confident that there should be no problem,
> > but if I am wrong, I will be in trouble.
> 
> Now I'm really really sure there will be no problem. What I wrote above
> about the gemotry is true I think, but all modern drives seem to have
> 255 heads and 63 sectors per track, so they will be compatible.
> 
> 	Wonko

Yep, I would be very surprised if what you're planning to do would
result in problems, as I've done several such operations in the past
without any issues. I've never had much to do with LVM, but the last
time I was doing this sort of thing I dd'd source drive to target
drive, resized /home (the last partition I always create) to fill the
new, larger disk, and that was that, the machine instantly booted fine.

Not exactly the same thing you are doing (especially as LVM is
involved in your setup), but I can see no major difference between
these two cases that looks like trouble.

Greetings,
Nils


-- 
Nils Holland * Ti Systems, Wunsorf-Luthe (Germany)
Powered by GNU/Linux since 1998



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 21:19         ` Alex Schuster
  2011-01-31 22:37           ` Nils Holland
@ 2011-01-31 22:39           ` Mick
  2011-02-01  0:34             ` Alex Schuster
  2011-01-31 22:57           ` Iain Buchanan
  2 siblings, 1 reply; 12+ messages in thread
From: Mick @ 2011-01-31 22:39 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 1039 bytes --]

On Monday 31 January 2011 21:19:44 Alex Schuster wrote:
> I just wrote:
> > My only fear is that the different drive geometry will be a problem, so
> > Grub does not find its stage2 in /boot, or file systems will unreadable
> > due to things being specified as head, cylinder and sector, instead of
> > absolute blocks. I'm pretty confident that there should be no problem,
> > but if I am wrong, I will be in trouble.
> 
> Now I'm really really sure there will be no problem. What I wrote above
> about the gemotry is true I think, but all modern drives seem to have
> 255 heads and 63 sectors per track, so they will be compatible.

Does this also include the new 4096 byte sectors that (some) of the new 1TB 
drives have?

TBH to avoid such conundrums I would partition the darn thing using parted 
with -a optimal option and then (s)tar/rsync the data into it.  It will most 
likely be faster than dd in any case as blank space and sparse files can be 
easily taken care of with (s)tar/rsync.

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 21:19         ` Alex Schuster
  2011-01-31 22:37           ` Nils Holland
  2011-01-31 22:39           ` Mick
@ 2011-01-31 22:57           ` Iain Buchanan
  2011-02-02 13:41             ` Alex Schuster
  2 siblings, 1 reply; 12+ messages in thread
From: Iain Buchanan @ 2011-01-31 22:57 UTC (permalink / raw
  To: gentoo-user

Hi,

On Mon, 2011-01-31 at 22:19 +0100, Alex Schuster wrote:

> Now I'm really really sure there will be no problem. What I wrote above
> about the gemotry is true I think, but all modern drives seem to have
> 255 heads and 63 sectors per track, so they will be compatible.
> 
> 	Wonko
> 


The only problem I see with dd is that it won't do any error checking,
afaik.  Will you have the old drive in as #2 later to double check?

The other option is clonezilla.  It will be a bit more work for you, but
you can script it to clone the partitions / drives / copy boot loaders
and so on.  Then the remote assistant can just boot it (from usb key
even) and press go!
-- 
Iain Buchanan <iaindb at netspace dot net dot au>

I bought some used paint. It was in the shape of a house.
		-- Steven Wright




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 22:39           ` Mick
@ 2011-02-01  0:34             ` Alex Schuster
  2011-02-01  8:42               ` Neil Bothwick
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Schuster @ 2011-02-01  0:34 UTC (permalink / raw
  To: gentoo-user

Mick writes:

> On Monday 31 January 2011 21:19:44 Alex Schuster wrote:

>> Now I'm really really sure there will be no problem. What I wrote above
>> about the gemotry is true I think, but all modern drives seem to have
>> 255 heads and 63 sectors per track, so they will be compatible.
> 
> Does this also include the new 4096 byte sectors that (some) of the new 1TB 
> drives have?

Ouch. Good point, Mick. I have no idea if this would be a problem. I'll
better make sure the new drive has the traditional block size.

I just heard that this Dell PC only supports up to 320G drives, but I
assume that means that Dell did sell them with this maximum capacity,
not that a larger drive won't work.

BTW, the PC only has space for one SATA drive. If the new drive would
also fit in, I could do the whole copy from remote, with minimum
downtime. But so the new drive has to be attached via USB first to clone
the original drive, and then it will replace it.

> TBH to avoid such conundrums I would partition the darn thing using parted 
> with -a optimal option and then (s)tar/rsync the data into it.  It will most 
> likely be faster than dd in any case as blank space and sparse files can be 
> easily taken care of with (s)tar/rsync.

But it involves much more typing than a single dd command. And more
things could go possibly wrong. There is not much free space on the
drive anyway, and no sparse files I know of.

And shouldn't dd be a little faster for a full drive because there is no
file system overhead, no seeking operations? In theory, dd should read
with maximum transfer rate as fast as the drive can deliver. But here we
have one USB drive, so things are slower anyway.

	Wonko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-02-01  0:34             ` Alex Schuster
@ 2011-02-01  8:42               ` Neil Bothwick
  0 siblings, 0 replies; 12+ messages in thread
From: Neil Bothwick @ 2011-02-01  8:42 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

On Tue, 01 Feb 2011 01:34:46 +0100, Alex Schuster wrote:

> And shouldn't dd be a little faster for a full drive because there is no
> file system overhead, no seeking operations?

Only is the drive is really full, and if it's that full the filesystem
will be fragmented horribly and a cloned copy is the last thing you want.

If it's not full, dd will be slower in terms of computer time but faster
in operator time.


-- 
Neil Bothwick

New sig wanted good price paid.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] dd'ing small drive to large one
  2011-01-31 22:57           ` Iain Buchanan
@ 2011-02-02 13:41             ` Alex Schuster
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Schuster @ 2011-02-02 13:41 UTC (permalink / raw
  To: gentoo-user

Iain Buchanan writes:

> On Mon, 2011-01-31 at 22:19 +0100, Alex Schuster wrote:
> > Now I'm really really sure there will be no problem. What I wrote above
> > about the gemotry is true I think, but all modern drives seem to have
> > 255 heads and 63 sectors per track, so they will be compatible.
> > 
> > 	Wonko
> 
> The only problem I see with dd is that it won't do any error checking,
> afaik.  Will you have the old drive in as #2 later to double check?

No, there's no space in this damn Dell desktop PC. If there were, we would 
just install the 2nd drive, and I would copy all stuff from remote. And then 
change grub so it boots from the 2nd drive. This would be a little 
unelegant, as I would copy the root partition while in use, but there should 
not be too much data that would change while I do this - probably not any 
data at all. For the /var partition, this would be different, but in 
practice this would probably work well either. Still, I would use the LVM 
snapshot feature for this.

But I never head a problem with dd. Do you mean read errors due to bad 
blocks? Then I should at least find something about this in the syslog. I 
could use dd-rescue though.
Or is it about other, undetected errors? Isn't there some CRC checksum by 
which ensure that would be detected? Or does dd not care about this?

> The other option is clonezilla.  It will be a bit more work for you, but
> you can script it to clone the partitions / drives / copy boot loaders
> and so on.  Then the remote assistant can just boot it (from usb key
> even) and press go!

Clonezilla sure looks interesting. I even has LVM support, so this probably 
could be done. Still, using only dd seems simpler to me, and more foolproof. 
But I'll check it out anyway. Thanks for the pointer.

	Wonko



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-02-02 14:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 17:34 [gentoo-user] dd'ing small drive to large one Alex Schuster
2011-01-31 18:19 ` Allan Gottlieb
2011-01-31 18:36   ` Alex Schuster
2011-01-31 19:16     ` Allan Gottlieb
2011-01-31 20:34       ` Alan McKinnon
     [not found]       ` <4D472323.6050007@wonkology.org>
2011-01-31 21:19         ` Alex Schuster
2011-01-31 22:37           ` Nils Holland
2011-01-31 22:39           ` Mick
2011-02-01  0:34             ` Alex Schuster
2011-02-01  8:42               ` Neil Bothwick
2011-01-31 22:57           ` Iain Buchanan
2011-02-02 13:41             ` Alex Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox