Re: Best way to replace a drive with a clone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux