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 > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 07-31-2010, 06:21 PM
Brian Millett
 
Default Best way to replace a drive with a clone

On Sat, 2010-07-31 at 12:59 -0500, Steven Stern wrote:
> According to the SMART stats, the single drive in my Fedora server is
> starting to fail. Rather than backup, do a clean install, and rebuild,
> I'd like to try to clone the existing drive to a new one, then swap in
> the new one.
>
> What are the restrictions on doing this and the best way to accomplish
> it? I have the Clonezilla Live CD that I use for backup. Will that do
> it?
>
> Or will a straight dd do it?
> add new drive as PATA slave /dev/sdb
> dd -if /dev/sda -of /dev/sdb
> remove /dev/sda
> change the jumpers on /dev/sdb to match what was /dev/sda
> reboot
>
> In the dd procedure, I'm not sure what to do if sdb is larger than sda.
>
> --
> -- Steve

Clonezilla will do a disk to disk clone which is very slick. Which will
fit into your 'dd' scenario. If you can do that, then that is the best.
Otherwise clonezilla can clone to an image which you know. Also see the
fsarchiver application available on systemrescuecd. I've used both with
great success. My personal preference is fsarchiver for partitions and
clonezilla for full disk.
--
Brian Millett - [ Kosh and Talia, "Deathwalker"]
"Ah. You seek meaning."
'Yes.'
"Then listen to the music, not the song."

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 06:37 PM
Steven Stern
 
Default Best way to replace a drive with a clone

On 07/31/2010 01:21 PM, Brian Millett wrote:
> On Sat, 2010-07-31 at 12:59 -0500, Steven Stern wrote:
>> According to the SMART stats, the single drive in my Fedora server is
>> starting to fail. Rather than backup, do a clean install, and rebuild,
>> I'd like to try to clone the existing drive to a new one, then swap in
>> the new one.
>>
>> What are the restrictions on doing this and the best way to accomplish
>> it? I have the Clonezilla Live CD that I use for backup. Will that do
>> it?
>>
>> Or will a straight dd do it?
>> add new drive as PATA slave /dev/sdb
>> dd -if /dev/sda -of /dev/sdb
>> remove /dev/sda
>> change the jumpers on /dev/sdb to match what was /dev/sda
>> reboot
>>
>> In the dd procedure, I'm not sure what to do if sdb is larger than sda.
>>
>> --
>> -- Steve
>
> Clonezilla will do a disk to disk clone which is very slick. Which will
> fit into your 'dd' scenario. If you can do that, then that is the best.
> Otherwise clonezilla can clone to an image which you know. Also see the
> fsarchiver application available on systemrescuecd. I've used both with
> great success. My personal preference is fsarchiver for partitions and
> clonezilla for full disk.
>
The thing that makes this difficult, at least to me, is that LVM is
involved.

--
-- Steve
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 07:10 PM
Antonio Olivares
 
Default Best way to replace a drive with a clone

--- On Sat, 7/31/10, Steven Stern <subscribed-lists@sterndata.com> wrote:

> From: Steven Stern <subscribed-lists@sterndata.com>
> Subject: Best way to replace a drive with a clone
> To: "Community support for Fedora users" <users@lists.fedoraproject.org>
> Date: Saturday, July 31, 2010, 10:59 AM
> According to the SMART stats, the
> single drive in my Fedora server is
> starting to fail.* Rather than backup, do a clean
> install, and rebuild,
> I'd like to try to clone the existing drive to a new one,
> then swap in
> the new one.
>
> What are the restrictions on doing this and the best way to
> accomplish
> it?*
Best way is subjective , There is no "Best way", however there are ways to do it
> I have the Clonezilla Live CD that I use for
> backup.* Will that do
> it?
>
Clonezilla will do it, provided that the new drive is the same size or bigger

The "bad thing" might be?, that Clonezilla also copies the "bad sectors" of the original hard drive?, but I am not sure though

>
> Or will a straight dd do it?
>
This could do it, but I would prefer Clonezilla
> * ***add new drive as PATA slave
> /dev/sdb
> * ***dd -if /dev/sda -of /dev/sdb
> * ***remove /dev/sda
> * ***change the jumpers on /dev/sdb to
> match what was /dev/sda
> * ***reboot
>
> In the dd procedure, I'm not sure what to do if sdb is
> larger than sda.
>
> --
> -- Steve
> --

Regards,

Antonio



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 07:16 PM
Andrew Haley
 
Default Best way to replace a drive with a clone

On 07/31/2010 06:59 PM, Steven Stern wrote:
> According to the SMART stats, the single drive in my Fedora server is
> starting to fail. Rather than backup, do a clean install, and rebuild,
> I'd like to try to clone the existing drive to a new one, then swap in
> the new one.
>
> What are the restrictions on doing this and the best way to accomplish
> it? I have the Clonezilla Live CD that I use for backup. Will that do
> it?
>
> Or will a straight dd do it?
> add new drive as PATA slave /dev/sdb
> dd -if /dev/sda -of /dev/sdb
> remove /dev/sda
> change the jumpers on /dev/sdb to match what was /dev/sda
> reboot
>
> In the dd procedure, I'm not sure what to do if sdb is larger than sda.

You can resize the FS later to occupy the whole partition.
It's worth doing an fsck first.

Alternatively, a recipe I always use to copy a partition is:

cd /newfs
dump 0f - /oldfs | restore rf -

This duplicates all the files, but onto a clean new filesystem.

Andrew.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 07:18 PM
Andrew Haley
 
Default Best way to replace a drive with a clone

On 07/31/2010 08:16 PM, Andrew Haley wrote:
> On 07/31/2010 06:59 PM, Steven Stern wrote:
>> According to the SMART stats, the single drive in my Fedora server is
>> starting to fail. Rather than backup, do a clean install, and rebuild,
>> I'd like to try to clone the existing drive to a new one, then swap in
>> the new one.
>>
>> What are the restrictions on doing this and the best way to accomplish
>> it? I have the Clonezilla Live CD that I use for backup. Will that do
>> it?
>>
>> Or will a straight dd do it?
>> add new drive as PATA slave /dev/sdb
>> dd -if /dev/sda -of /dev/sdb
>> remove /dev/sda
>> change the jumpers on /dev/sdb to match what was /dev/sda
>> reboot
>>
>> In the dd procedure, I'm not sure what to do if sdb is larger than sda.
>
> You can resize the FS later to occupy the whole partition.
> It's worth doing an fsck first.
>
> Alternatively, a recipe I always use to copy a partition is:
>
> cd /newfs
> dump 0f - /oldfs | restore rf -

BTW, you should either do this in single user mode or with the fs
unmounted or readonly.

> This duplicates all the files, but onto a clean new filesystem.
>
> Andrew.

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 08:05 PM
Steven Stern
 
Default Best way to replace a drive with a clone

On 07/31/2010 02:18 PM, Andrew Haley wrote:
> On 07/31/2010 08:16 PM, Andrew Haley wrote:
>> On 07/31/2010 06:59 PM, Steven Stern wrote:
>>> According to the SMART stats, the single drive in my Fedora server is
>>> starting to fail. Rather than backup, do a clean install, and rebuild,
>>> I'd like to try to clone the existing drive to a new one, then swap in
>>> the new one.
>>>
>>> What are the restrictions on doing this and the best way to accomplish
>>> it? I have the Clonezilla Live CD that I use for backup. Will that do
>>> it?
>>>
>>> Or will a straight dd do it?
>>> add new drive as PATA slave /dev/sdb
>>> dd -if /dev/sda -of /dev/sdb
>>> remove /dev/sda
>>> change the jumpers on /dev/sdb to match what was /dev/sda
>>> reboot
>>>
>>> In the dd procedure, I'm not sure what to do if sdb is larger than sda.
>>
>> You can resize the FS later to occupy the whole partition.
>> It's worth doing an fsck first.
>>
>> Alternatively, a recipe I always use to copy a partition is:
>>
>> cd /newfs
>> dump 0f - /oldfs | restore rf -
>
> BTW, you should either do this in single user mode or with the fs
> unmounted or readonly.
>
>> This duplicates all the files, but onto a clean new filesystem.
>>
>> Andrew.
>

I like that. Thanks.

--
-- Steve
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 08:21 PM
Jussi Lehtola
 
Default Best way to replace a drive with a clone

On Sat, 2010-07-31 at 12:59 -0500, Steven Stern wrote:
> According to the SMART stats, the single drive in my Fedora server is
> starting to fail. Rather than backup, do a clean install, and rebuild,
> I'd like to try to clone the existing drive to a new one, then swap in
> the new one.
>
> What are the restrictions on doing this and the best way to accomplish
> it? I have the Clonezilla Live CD that I use for backup. Will that do
> it?
>
> Or will a straight dd do it?
> add new drive as PATA slave /dev/sdb
> dd -if /dev/sda -of /dev/sdb
> remove /dev/sda
> change the jumpers on /dev/sdb to match what was /dev/sda
> reboot
>
> In the dd procedure, I'm not sure what to do if sdb is larger than sda.

What I normally do is boot the system e.g. with the Fedora install CD in
rescue mode, which automatically mounts the old system, and then I

1. partition new drive
2. format partitions on new drive
3. mount new filesystem tree in e.g. /mnt/newroot
4. run
# rsync -au /mnt/sysimage/ /mnt/newroot/
5. edit fstab in new etc to reflect new partitions
6. install grub on new drive
7. unmount and reboot

This way you can easily change the sizes of partitions and also their
file systems, which can be handy if you want to take advantage of new
file system features. And, you only copy the data, not empty space (I
don't think dd does this, although smarter tools should do it).

Also, if you're running SELinux run
# touch /mnt/newroot/.autorelabel
before rebooting, since rsync doesn't preserve security contexts..
--
Jussi Lehtola
Fedora Project Contributor
jussilehtola@fedoraproject.org

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-31-2010, 11:45 PM
Steven Stern
 
Default Best way to replace a drive with a clone

On 07/31/2010 03:21 PM, Jussi Lehtola wrote:
> On Sat, 2010-07-31 at 12:59 -0500, Steven Stern wrote:
>> According to the SMART stats, the single drive in my Fedora server is
>> starting to fail. Rather than backup, do a clean install, and rebuild,
>> I'd like to try to clone the existing drive to a new one, then swap in
>> the new one.
>>
>> What are the restrictions on doing this and the best way to accomplish
>> it? I have the Clonezilla Live CD that I use for backup. Will that do
>> it?
>>
>> Or will a straight dd do it?
>> add new drive as PATA slave /dev/sdb
>> dd -if /dev/sda -of /dev/sdb
>> remove /dev/sda
>> change the jumpers on /dev/sdb to match what was /dev/sda
>> reboot
>>
>> In the dd procedure, I'm not sure what to do if sdb is larger than sda.
>
> What I normally do is boot the system e.g. with the Fedora install CD in
> rescue mode, which automatically mounts the old system, and then I
>
> 1. partition new drive
> 2. format partitions on new drive
> 3. mount new filesystem tree in e.g. /mnt/newroot
> 4. run
> # rsync -au /mnt/sysimage/ /mnt/newroot/
> 5. edit fstab in new etc to reflect new partitions
> 6. install grub on new drive
> 7. unmount and reboot
>
> This way you can easily change the sizes of partitions and also their
> file systems, which can be handy if you want to take advantage of new
> file system features. And, you only copy the data, not empty space (I
> don't think dd does this, although smarter tools should do it).
>
> Also, if you're running SELinux run
> # touch /mnt/newroot/.autorelabel
> before rebooting, since rsync doesn't preserve security contexts..

Cool. Thanks.

--
-- Steve
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-01-2010, 05:00 AM
"Christofer C. Bell"
 
Default Best way to replace a drive with a clone

On Sat, Jul 31, 2010 at 3:21 PM, Jussi Lehtola
<jussilehtola@fedoraproject.org> wrote:
>
> Also, if you're running SELinux run
> *# touch /mnt/newroot/.autorelabel
> before rebooting, since rsync doesn't preserve security contexts..

Just use "rsync -aAHX" instead of "rsync -au" and you don't have to
worry about an autorelabel (rsync will properly preserve selinux
labels if you give it the correct flags).

--
Chris
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 02:31 AM.

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