From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1NW8c8-0000mM-9p for garchives@archives.gentoo.org; Sat, 16 Jan 2010 13:22:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 340E3E0757; Sat, 16 Jan 2010 13:22:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E6B34E0757 for ; Sat, 16 Jan 2010 13:22:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 1E9821B4016 for ; Sat, 16 Jan 2010 13:22:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -3.104 X-Spam-Level: X-Spam-Status: No, score=-3.104 required=5.5 tests=[AWL=-0.505, BAYES_00=-2.599] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id khFL3dFxQ0nN for ; Sat, 16 Jan 2010 13:22:02 +0000 (UTC) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 4958A67832 for ; Sat, 16 Jan 2010 13:22:01 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NW8bE-0002zn-Ix for gentoo-user@gentoo.org; Sat, 16 Jan 2010 14:21:56 +0100 Received: from athedsl-392452.home.otenet.gr ([79.131.85.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jan 2010 14:21:56 +0100 Received: from realnc by athedsl-392452.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jan 2010 14:21:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-user] Re: How can I move system to new disk? Date: Sat, 16 Jan 2010 15:21:32 +0200 Organization: Lucas Barks Message-ID: References: <4B50A6F0.8060404@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-392452.home.otenet.gr User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20100107 Thunderbird/3.0 In-Reply-To: <4B50A6F0.8060404@gmail.com> Sender: news X-Archives-Salt: e2ae6b88-62cf-48e5-a1d3-b8e7b8b1e59a X-Archives-Hash: 7d4fd632a8f13bee11bfa2f0d611f3fb On 01/15/2010 07:33 PM, Jarry wrote: > Hi, I'm facing this problem: > > I want to exchange hard-drive in my computer for other, bigger > one. I do not want to add new hard-drive somewhere on mount-point > permanently, I just want to copy everything from the old drive > to the new one and then get rid of the old one. And of course, > I'd like to use my computer as before. What is the best (maybe > I should ask for safest) way to acomplish this? > > First I thought about "cp -a". But I'm not sure which directories > I should skip (/proc, maybe some other like /dev?). And I do not > know how cp handles links (if I first copy link and later target, > where is the link pointing? to the original file or its copy?). > > Maybe dump/restore is better solution? Or something else? I'll just copy the instructions I have someone else here: You can clone the existing Gentoo installation into the new partition and boot from it. You can do this while the system is actually running. The new partition can be anything you want (different size, different file system). This usually means: rsync your existing / to your target / (except /dev, /sys and /proc and of course mount points that belong to a different filesystem, /boot or /home for example if you're using dedicated partitions for those). If you mounted your target / as /root/newpart, this is done with: rsync -ax / /root/newpart If this copied directories it shouldn't have (like /sys or /proc), simply delete them again. Then: mkdir /root/newpart/dev mkdir /root/newpart/proc mkdir /root/newpart/sys mknod /root/newpart/dev/console c 5 1 mknod /root/newpart/null c 1 3 touch /root/newpart/dev/.keep touch /root/newpart/proc/.keep touch /root/newpart/sys/.keep Now chroot into it to set up the boot loader (I assume you use Grub): mount -t proc none /root/newpart/proc mount -o bind /dev /root/newpart/dev chroot /root/newpart /bin/bash Now edit /etc/fstab to use the new partition and edit /boot/grub/grub.conf and reinstall grub: grub root (hd0,0) <-- sustitute with what you really have/want setup quit You're ready. Leave the chroot and unmount: exit umount /root/newpart/dev umount /root/newpart/proc If you've set up grub correctly while in the chroot, you can now reboot and the system should come up using the new partition. If you used a different filesystem for the new partition (for example going from ext3 to ext4), make sure your kernel supports the new filesystem.