Re: [gentoo-user] dd'ing small drive to large one

2011-02-01 Thread Neil Bothwick
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.


signature.asc
Description: PGP signature


[gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Alex Schuster
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Allan Gottlieb
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Alex Schuster
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Allan Gottlieb
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Alan McKinnon
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Alex Schuster
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Nils Holland
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



Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Mick
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


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Iain Buchanan
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




Re: [gentoo-user] dd'ing small drive to large one

2011-01-31 Thread Alex Schuster
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