FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-31-2011, 05:36 PM
Alex Schuster
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 06:16 PM
Allan Gottlieb
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 07:34 PM
Alan McKinnon
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 08:01 PM
Alex Schuster
 
Default dd'ing small drive to large one

Allan Gottlieb writes:

> On Mon, Jan 31 2011, Alex Schuster wrote:
>
>> Allan Gottlieb writes:

>>> 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.

Yes, the PC am using LVM at least for /usr, /var, /opt and /home. And
it's only /home I'm interested in, as this partition is currently
getting full and fuller.
Without LVM, I would simply enlarge the last partition and run resize2fs
on it, if this were the /home partition. If /home were not the last
partition, I could just add another partiton taking the additional space
this drive has and copy /home there. And then I would have to find some
use for the old /home, or just ignore it until the new /home will get
full, which probably will never ever happen.

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.

Wonko
 
Old 01-31-2011, 08:19 PM
Alex Schuster
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 09:37 PM
Nils Holland
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 09:39 PM
Mick
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 09:57 PM
Iain Buchanan
 
Default dd'ing small drive to large one

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
 
Old 01-31-2011, 11:34 PM
Alex Schuster
 
Default dd'ing small drive to large one

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
 
Old 02-01-2011, 07:42 AM
Neil Bothwick
 
Default dd'ing small drive to large one

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.
 

Thread Tools




All times are GMT. The time now is 04:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org