easiest way to replace hard drive?

2009-10-08 Thread Dr. Michael J. Chudobiak

Hi all,

Is there an easy way to transfer a system from one drive (holding boot, 
swap, lvm partitions, in the default F11 layout) to a different hard 
drive, if the new drive is smaller?


If the new drive is larger, dd could be used in a fairly straightforward 
way.


However, I want to try replacing a 160 GB hard drive with an Intel 80 GB 
solid-state drive, just for fun...


I suspect a re-install might be easier.

- Mike

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Tom Horsley
> However, I want to try replacing a 160 GB hard drive with an Intel 80 GB 
> solid-state drive, just for fun...
> 
> I suspect a re-install might be easier.

We have used rsync plus grub-install to clone systems before,
and it seemed to work fine (if you get the 6 million nit-picky
rsync options correct :-).

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Jatin K

On 10/08/2009 10:18 PM, Dr. Michael J. Chudobiak wrote:

I suspect a re-install
Reinstallation will be easy .but if there is no any important data 
on the drive then there is nothing wrong to do a experiment ;-)


just look at this [1]

[1] http://www.partimage.org/Main_Page

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Daniel B. Thurman
On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
> Hi all,
>
> Is there an easy way to transfer a system from one drive (holding
> boot, swap, lvm partitions, in the default F11 layout) to a different
> hard drive, if the new drive is smaller?
>
> If the new drive is larger, dd could be used in a fairly
> straightforward way.
>
> However, I want to try replacing a 160 GB hard drive with an Intel 80
> GB solid-state drive, just for fun...
>
> I suspect a re-install might be easier.
>
> - Mike
>
For me:

1) Shutdown and install the drive
2) Boot LiveCD (I use Ubuntu because "partition manager" is included)
3) Partition new drive with "partition manager"
4) mkdir /mnt/a /mnt/b
5) mount /dev/sdXx /mnt/a   (Old)
6) mount /dev/sdYy /mnt/b   (New)
7) (a) cp -a /mnt/a/. /mnt/b/. OR
(b) rsync -avz /mnt/a/. /mnt/b/.
8) umount /mnt/a /mnt/b
9) Repeat steps 5-8 for each partition to copy over
10) rmdir /mnt/a /mnt/b
11) Relabel each new partitions (Label or UUID), update fstab & grub (if
included)
12) execute: grub
  (a) find /grub/stage1  <-- locate the boot (grub) partitions of
all drives seen by the Bios
  (b) root (hdX,Y)  <-- set the root to the new drive's boot partition
  (c) setup (hdX,Y) <-- sets up the new drives's MBR with root
(boot) partition information
  (d) quit
13) Remove LiveCD & shutdown or reboot
14) Set remove the old drive OR set the BIOS to default to
  the new drive OR add new drive information to old drive grub

Note:
The above assumes that new drive has enough space
for the data copied over from the old drive partitions as
step 7 copies only the data and not the entire partition image.

FWIW,
Dan

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Konstantin Svist

On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:

Hi all,

Is there an easy way to transfer a system from one drive (holding 
boot, swap, lvm partitions, in the default F11 layout) to a different 
hard drive, if the new drive is smaller?


If the new drive is larger, dd could be used in a fairly 
straightforward way.


However, I want to try replacing a 160 GB hard drive with an Intel 80 
GB solid-state drive, just for fun...


I suspect a re-install might be easier.

- Mike



gparted (or qtparted) will do what you want. I don't remember if it can 
resize the partitions as you copy them, but in the worst case you can 
resize first then copy.


or you can use cp -a to copy over all necessary files and run 
grub-install to restore the grub boot loader if it's installed in MBR 
(default)




--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Daniel B. Thurman
On 10/08/2009 10:31 AM, Konstantin Svist wrote:
> On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
>> Hi all,
>>
>> Is there an easy way to transfer a system from one drive (holding
>> boot, swap, lvm partitions, in the default F11 layout) to a different
>> hard drive, if the new drive is smaller?
>>
>> If the new drive is larger, dd could be used in a fairly
>> straightforward way.
>>
>> However, I want to try replacing a 160 GB hard drive with an Intel 80
>> GB solid-state drive, just for fun...
>>
>> I suspect a re-install might be easier.
>>
>> - Mike
>>
>
> gparted (or qtparted) will do what you want. I don't remember if it
> can resize the partitions as you copy them, but in the worst case you
> can resize first then copy.
>
> or you can use cp -a to copy over all necessary files and run
> grub-install to restore the grub boot loader if it's installed in MBR
> (default)
>
There is a potential problem when using partition resizing - it can mess
up the partition tables and render the drive unbootable - need to be
careful here, as it "bit me in the a.."!

FWIW,
Dan

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Joel Gomberg

On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:

Hi all,

Is there an easy way to transfer a system from one drive (holding boot,
swap, lvm partitions, in the default F11 layout) to a different hard
drive, if the new drive is smaller?

If the new drive is larger, dd could be used in a fairly straightforward
way.

However, I want to try replacing a 160 GB hard drive with an Intel 80 GB
solid-state drive, just for fun...


Clonezilla worked like a charm for me, but I was going from a smaller drive to a 
larger one.  I believe that it can handle your situation.


--
Joel

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Paul
Daniel B. Thurman wrote:
> On 10/08/2009 10:31 AM, Konstantin Svist wrote:
>   
>> On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
>> 
>>> Hi all,
>>>
>>> Is there an easy way to transfer a system from one drive (holding
>>> boot, swap, lvm partitions, in the default F11 layout) to a different
>>> hard drive, if the new drive is smaller?
>>>
>>> If the new drive is larger, dd could be used in a fairly
>>> straightforward way.
>>>
>>> However, I want to try replacing a 160 GB hard drive with an Intel 80
>>> GB solid-state drive, just for fun...
>>>
>>> I suspect a re-install might be easier.
>>>
>>> - Mike
>>>
>>>   
>> gparted (or qtparted) will do what you want. I don't remember if it
>> can resize the partitions as you copy them, but in the worst case you
>> can resize first then copy.
>>
>> or you can use cp -a to copy over all necessary files and run
>> grub-install to restore the grub boot loader if it's installed in MBR
>> (default)
>>
>> 
> There is a potential problem when using partition resizing - it can mess
> up the partition tables and render the drive unbootable - need to be
> careful here, as it "bit me in the a.."!
>
> FWIW,
> Dan
>   
Your easiest option might simply be a "bare metal" backup and restore, backing 
up from the old drive and restoring to the new.

This also may work, but I am pretty sure I am missing at least one important 
thing that hopefully someone else will point out so that you can use this 
method:

* Set up the drive ahead of time with the same partitions as your existing one, 
greater than or equal to the existing size of each partition. You may encounter 
problems if you are going to make any new partition smaller, even if the new 
one is still large enough to hold all of the data.

* Do as Konstantin suggested above to copy the files over and then make GRUB 
set itself up to hopefully boot the system for you off the new drive.



This is off the top of my head so unless you know what you're doing, I wouldn't 
recommend trying it until a few people have ripped it to pieces and corrected 
whatever flaws I have missed or inadvertently inserted. No warranties express 
or implied, and I am not responsible if you foobar your system trying this, 
etc. etc.



-- 


Paul


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Re: easiest way to replace hard drive?

2009-10-08 Thread Mikkel
Joel Gomberg wrote:
> On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
>> Hi all,
>>
>> Is there an easy way to transfer a system from one drive (holding boot,
>> swap, lvm partitions, in the default F11 layout) to a different hard
>> drive, if the new drive is smaller?
>>
>> If the new drive is larger, dd could be used in a fairly straightforward
>> way.
>>
Tools like parted work better - they only copy the data on file
systems they know about. But they do not handle LVM yet. They can
only do a full copy - about like using dd to copy a partition.

>> However, I want to try replacing a 160 GB hard drive with an Intel 80 GB
>> solid-state drive, just for fun...
> 
> Clonezilla worked like a charm for me, but I was going from a smaller
> drive to a larger one.  I believe that it can handle your situation.
> 
It does not handle changing the size of LVM partitions. So you are
probably going to be stuck with resizing them first.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!



signature.asc
Description: OpenPGP digital signature
-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Re: easiest way to replace hard drive?

2009-10-08 Thread Konstantin Svist

On 10/08/2009 10:47 AM, Daniel B. Thurman wrote:

On 10/08/2009 10:31 AM, Konstantin Svist wrote:
   

On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
 

Hi all,

Is there an easy way to transfer a system from one drive (holding
boot, swap, lvm partitions, in the default F11 layout) to a different
hard drive, if the new drive is smaller?

If the new drive is larger, dd could be used in a fairly
straightforward way.

However, I want to try replacing a 160 GB hard drive with an Intel 80
GB solid-state drive, just for fun...

I suspect a re-install might be easier.

- Mike

   

gparted (or qtparted) will do what you want. I don't remember if it
can resize the partitions as you copy them, but in the worst case you
can resize first then copy.

or you can use cp -a to copy over all necessary files and run
grub-install to restore the grub boot loader if it's installed in MBR
(default)

 

There is a potential problem when using partition resizing - it can mess
up the partition tables and render the drive unbootable - need to be
careful here, as it "bit me in the a.."!

FWIW,
Dan

   


Really?
I've never had gparted bite me in the ass like that. Happened a few 
times with PartitionMagic in the past, though.



--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread jonr

Quoting "Dr. Michael J. Chudobiak" :


Hi all,

Is there an easy way to transfer a system from one drive (holding  
boot, swap, lvm partitions, in the default F11 layout) to a  
different hard drive, if the new drive is smaller?


If the new drive is larger, dd could be used in a fairly straightforward way.

However, I want to try replacing a 160 GB hard drive with an Intel  
80 GB solid-state drive, just for fun...


I suspect a re-install might be easier.

- Mike


I would think you would need to do a lvreduce and possibly a vgreduce  
to get the data portion of the drive under 80GB. From there I think a  
'dd' would work just fine.


Part-image, as someone else suggested, is also a good choice. It only  
copies the data portions of the drive leaving the free blocks alone.  
So it only copies those blocks that have data.


Jon


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Dr. Michael J. Chudobiak

I would think you would need to do a lvreduce and possibly a vgreduce to
get the data portion of the drive under 80GB. From there I think a 'dd'
would work just fine.


With a resize2fs first, I guess...

Anyway, thanks for all the suggestions, everyone!

It looks like a minefield, so I'm going to do a fresh install and copy 
what I need. That way I can fall back to my old hard drive, if need be.


- Mike

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Daniel B. Thurman
On 10/08/2009 12:13 PM, Konstantin Svist wrote:
> On 10/08/2009 10:47 AM, Daniel B. Thurman wrote:
>> On 10/08/2009 10:31 AM, Konstantin Svist wrote:
>>   
>>> On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
>>> 
 Hi all,

 Is there an easy way to transfer a system from one drive (holding
 boot, swap, lvm partitions, in the default F11 layout) to a different
 hard drive, if the new drive is smaller?

 If the new drive is larger, dd could be used in a fairly
 straightforward way.

 However, I want to try replacing a 160 GB hard drive with an Intel 80
 GB solid-state drive, just for fun...

 I suspect a re-install might be easier.

 - Mike


>>> gparted (or qtparted) will do what you want. I don't remember if it
>>> can resize the partitions as you copy them, but in the worst case you
>>> can resize first then copy.
>>>
>>> or you can use cp -a to copy over all necessary files and run
>>> grub-install to restore the grub boot loader if it's installed in MBR
>>> (default)
>>>
>>>  
>> There is a potential problem when using partition resizing - it can mess
>> up the partition tables and render the drive unbootable - need to be
>> careful here, as it "bit me in the a.."!
>>
>> FWIW,
>> Dan
>>
>>
>
> Really?
> I've never had gparted bite me in the ass like that. Happened a few
> times with PartitionMagic in the past, though.
>
>
Yes.  What happened was that different resizing and moving partitions around
left behind "ghost" table entries and confused certain disk programs but was
transparent to fdisk.  I was forced to erase the entire drive and lay down
the partitions ONCE, and leave it alone.  What I decided to do was to set
each of my new OS drives in a specific way, every time, allowing for
multiple
OS installations, planned or not. This was not a problem with older versions
of linux distros, but Fedora changed *something* in regards to the anaconda
installer and it FAILED to find a SINGLE partition because it "barfed"
when it
encountered "extraneous" table entries.  This happened to me for F10 and for
F11.  I did not wanted to go through that nightmare again.

It is possible there was a bug, but since it happened to me on F10 & F11,
this is the course of action that I decided to take, at least, for now.

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Dave Ihnat
On Thu, Oct 08, 2009 at 12:48:13PM -0400, Dr. Michael J. Chudobiak wrote:
> However, I want to try replacing a 160 GB hard drive with an Intel 80 GB  
> solid-state drive, just for fun...

You have an interesting definition of fun...
--
Dave Ihnat
dih...@dminet.com

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-08 Thread Aldo Foot
On Thu, Oct 8, 2009 at 1:10 PM, Dr. Michael J. Chudobiak
 wrote:
>> I would think you would need to do a lvreduce and possibly a vgreduce to
>> get the data portion of the drive under 80GB. From there I think a 'dd'
>> would work just fine.
>
> With a resize2fs first, I guess...
>
> Anyway, thanks for all the suggestions, everyone!
>
> It looks like a minefield, so I'm going to do a fresh install and copy what
> I need. That way I can fall back to my old hard drive, if need be.
>
> - Mike
_

Why miss the real fun?  Try Clonezilla; it can image a drive inside of 20min.

~af

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-09 Thread Dr. Michael J. Chudobiak

On 10/08/2009 08:10 PM, Aldo Foot wrote:


Why miss the real fun?  Try Clonezilla; it can image a drive inside of 20min.


But it can not image to a smaller drive, alas.

- Mike

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-09 Thread Patrick O'Callaghan
On Thu, 2009-10-08 at 12:48 -0400, Dr. Michael J. Chudobiak wrote:
> Is there an easy way to transfer a system from one drive (holding
> boot, 
> swap, lvm partitions, in the default F11 layout) to a different hard 
> drive, if the new drive is smaller?
> 
> If the new drive is larger, dd could be used in a fairly
> straightforward way.

Yes and no. dd copies *everything*, including the filesystem superblock,
so the larger drive will still think it's the size of the smaller one.

poc

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: easiest way to replace hard drive?

2009-10-09 Thread Joe

Try to mount new hd under /media/newhd

tar --exclude media/newhd/\* --exclude proc/\* --exclude dev/\* 
--exclude sys/\* -pcf - ./ | tar -pxvf - -C /media/newhd/


cu Joe

On 10/09/2009 04:28 PM, Patrick O'Callaghan wrote:

On Thu, 2009-10-08 at 12:48 -0400, Dr. Michael J. Chudobiak wrote:
   

Is there an easy way to transfer a system from one drive (holding
boot,
swap, lvm partitions, in the default F11 layout) to a different hard
drive, if the new drive is smaller?

If the new drive is larger, dd could be used in a fairly
straightforward way.
 

Yes and no. dd copies *everything*, including the filesystem superblock,
so the larger drive will still think it's the size of the smaller one.

poc

   


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines