* [gentoo-user] How can I move system to new disk?
@ 2010-01-15 17:33 Jarry
2010-01-15 17:48 ` Hazen Valliant-Saunders
` (5 more replies)
0 siblings, 6 replies; 20+ messages in thread
From: Jarry @ 2010-01-15 17:33 UTC (permalink / raw
To: gentoo-user
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?
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
@ 2010-01-15 17:48 ` Hazen Valliant-Saunders
2010-01-15 18:00 ` Hazen Valliant-Saunders
2010-01-15 18:09 ` Dale
2010-01-15 18:18 ` [gentoo-user] " Remy Blank
` (4 subsequent siblings)
5 siblings, 2 replies; 20+ messages in thread
From: Hazen Valliant-Saunders @ 2010-01-15 17:48 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]
Tar is your friend and ally.
1. install and Mount the disk to a mount point.
2. Use tar in for it's intended purpose
https://help.ubuntu.com/community/BackupYourSystem/TAR
3. remove old drive, & configure the new one as your primary.
4. get a drink.
On Fri, Jan 15, 2010 at 12:33 PM, Jarry <mr.jarry@gmail.com> 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?
>
> Jarry
>
> --
> _______________________________________________________________
> This mailbox accepts e-mails only from selected mailing-lists!
> Everything else is considered to be spam and therefore deleted.
>
>
--
Hazen Valliant-Saunders
IT/IS Consultant
(613) 355-5977
[-- Attachment #2: Type: text/html, Size: 1857 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 17:48 ` Hazen Valliant-Saunders
@ 2010-01-15 18:00 ` Hazen Valliant-Saunders
2010-01-15 18:09 ` Dale
1 sibling, 0 replies; 20+ messages in thread
From: Hazen Valliant-Saunders @ 2010-01-15 18:00 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1907 bytes --]
remember to use --exclude to "exclude" your new drive's mounted point. \
and to use a pipe
so your command would look like:
root@yoursystem #cd /
root@yoursystem #tar -cvpzf - -–exclude=/- --exclude=/mnt/newdrive | cd
/mnt/newdrive (tar -xvpf -)
If all else fails!
# man tar
Regards,
Hazen.
On Fri, Jan 15, 2010 at 12:48 PM, Hazen Valliant-Saunders <hazenvs@gmail.com
> wrote:
> Tar is your friend and ally.
>
> 1. install and Mount the disk to a mount point.
> 2. Use tar in for it's intended purpose
> https://help.ubuntu.com/community/BackupYourSystem/TAR
> 3. remove old drive, & configure the new one as your primary.
> 4. get a drink.
>
> On Fri, Jan 15, 2010 at 12:33 PM, Jarry <mr.jarry@gmail.com> 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?
>>
>> Jarry
>>
>> --
>> _______________________________________________________________
>> This mailbox accepts e-mails only from selected mailing-lists!
>> Everything else is considered to be spam and therefore deleted.
>>
>>
>
>
> --
> Hazen Valliant-Saunders
> IT/IS Consultant
> (613) 355-5977
>
--
Hazen Valliant-Saunders
IT/IS Consultant
(613) 355-5977
[-- Attachment #2: Type: text/html, Size: 2748 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 17:48 ` Hazen Valliant-Saunders
2010-01-15 18:00 ` Hazen Valliant-Saunders
@ 2010-01-15 18:09 ` Dale
2010-01-15 18:17 ` Hazen Valliant-Saunders
1 sibling, 1 reply; 20+ messages in thread
From: Dale @ 2010-01-15 18:09 UTC (permalink / raw
To: gentoo-user
Hazen Valliant-Saunders wrote:
> Tar is your friend and ally.
>
> 1. install and Mount the disk to a mount point.
> 2. Use tar in for it's intended purpose
> https://help.ubuntu.com/community/BackupYourSystem/TAR
> 3. remove old drive, & configure the new one as your primary.
> 4. get a drink.
>
> On Fri, Jan 15, 2010 at 12:33 PM, Jarry <mr.jarry@gmail.com
> <mailto:mr.jarry@gmail.com>> 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?
>
> Jarry
>
> --
> _______________________________________________________________
> This mailbox accepts e-mails only from selected mailing-lists!
> Everything else is considered to be spam and therefore deleted.
>
>
I have done this several times and only used cp -a. I just skipped
/dev, /proc, /tmp and other none needed ones. Don't forget to copy
console and null in /dev tho.
Dale
:-) :-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 18:09 ` Dale
@ 2010-01-15 18:17 ` Hazen Valliant-Saunders
0 siblings, 0 replies; 20+ messages in thread
From: Hazen Valliant-Saunders @ 2010-01-15 18:17 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]
cp -a works, i just like pipes.
On Fri, Jan 15, 2010 at 1:09 PM, Dale <rdalek1967@gmail.com> wrote:
> Hazen Valliant-Saunders wrote:
>
>> Tar is your friend and ally.
>>
>> 1. install and Mount the disk to a mount point.
>> 2. Use tar in for it's intended purpose
>> https://help.ubuntu.com/community/BackupYourSystem/TAR
>> 3. remove old drive, & configure the new one as your primary.
>> 4. get a drink.
>>
>> On Fri, Jan 15, 2010 at 12:33 PM, Jarry <mr.jarry@gmail.com <mailto:
>> mr.jarry@gmail.com>> 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?
>>
>> Jarry
>>
>> -- _______________________________________________________________
>> This mailbox accepts e-mails only from selected mailing-lists!
>> Everything else is considered to be spam and therefore deleted.
>>
>>
>>
>
> I have done this several times and only used cp -a. I just skipped /dev,
> /proc, /tmp and other none needed ones. Don't forget to copy console and
> null in /dev tho.
>
> Dale
>
> :-) :-)
>
--
Hazen Valliant-Saunders
IT/IS Consultant
(613) 355-5977
[-- Attachment #2: Type: text/html, Size: 2633 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [gentoo-user] Re: How can I move system to new disk?
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
2010-01-15 17:48 ` Hazen Valliant-Saunders
@ 2010-01-15 18:18 ` Remy Blank
2010-01-15 20:12 ` Szénási István
2010-01-15 18:32 ` [gentoo-user] " Zhu Sha Zang
` (3 subsequent siblings)
5 siblings, 1 reply; 20+ messages in thread
From: Remy Blank @ 2010-01-15 18:18 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
Jarry wrote:
> Maybe dump/restore is better solution? Or something else?
Boot a live CD, mount a source partition to /mnt/src, a destination
partition to /mnt/dst (with the right options, e.g. "acl" and
"user_xattr" if you use them), then:
rsync -avHAX /mnt/src/ /mnt/dst
(The slash after "src" is intentional.)
Repeat with all partitions. Then install GRUB to the MBR of the new disk.
-- Remy
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
2010-01-15 17:48 ` Hazen Valliant-Saunders
2010-01-15 18:18 ` [gentoo-user] " Remy Blank
@ 2010-01-15 18:32 ` Zhu Sha Zang
2010-01-16 10:26 ` Alexander
` (2 subsequent siblings)
5 siblings, 0 replies; 20+ messages in thread
From: Zhu Sha Zang @ 2010-01-15 18:32 UTC (permalink / raw
To: gentoo-user
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Em 15-01-2010 15:33, Jarry escreveu:
> 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?
>
> Jarry
>
In a small cluster with machines have the same configuration (or not,
when newer hd are more bigger than the oldest) i use a live cd and cp
- -pr /mnt/gentoo/* /mnt/gentoo2/*.
Works fine. Changing hostname and ip and i have a new cluster client.
Better than ghost that don't change mbr or dd. A "shutdown -Fr now" in
a first reboot is a good idea.
att
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAktQtKUACgkQ35zeJy7JhCh/rQCcDO7hr/0V64cnHBudL2BseQKg
OtEAn2P13ZvQXDprMCNrNbCNEGGD0GJw
=zlNP
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-15 18:18 ` [gentoo-user] " Remy Blank
@ 2010-01-15 20:12 ` Szénási István
2010-01-15 23:11 ` Stroller
0 siblings, 1 reply; 20+ messages in thread
From: Szénási István @ 2010-01-15 20:12 UTC (permalink / raw
To: gentoo-user
And what about dd?
Not the fastest solution, but it is copy the mbr, the boot loader, the
partition table and all partitions. After it you should use the parted
or the gparted to move/resize the necesarry partitions.
--
Szénási István
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-15 20:12 ` Szénási István
@ 2010-01-15 23:11 ` Stroller
2010-01-16 9:57 ` Szénási István
0 siblings, 1 reply; 20+ messages in thread
From: Stroller @ 2010-01-15 23:11 UTC (permalink / raw
To: gentoo-user
On 15 Jan 2010, at 20:12, Szénási István wrote:
> And what about dd?
> Not the fastest solution, but it is copy the mbr, the boot loader, the
> partition table and all partitions. After it you should use the parted
> or the gparted to move/resize the necesarry partitions.
It should be mentioned that if you use this method then, after running
parted to resize the partition(s), you will also need to resize the
filesystem(s) on the partition(s).
This is well documented - google "resize ext3" or whatever. Not sure
if this is necessary using GParted - probably not.
Stroller.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-15 23:11 ` Stroller
@ 2010-01-16 9:57 ` Szénási István
2010-01-16 15:59 ` ubiquitous1980
0 siblings, 1 reply; 20+ messages in thread
From: Szénási István @ 2010-01-16 9:57 UTC (permalink / raw
To: gentoo-user
> It should be mentioned that if you use this method then, after running
> parted to resize the partition(s), you will also need to resize the
> filesystem(s) on the partition(s).
If I remember correctly, you're right and the resize of he filesystem required.
Of course if you shrink the partition, first you need to resize the
file system before the
resizing of the partition and if you grow the partition, first you
need to resize the partition
before the resizing the file system. (Maybe, you should turn off the
journalling when you
modify an ext3 file system, but i am not sure in it)
> This is well documented - google "resize ext3" or whatever. Not sure if this
> is necessary using GParted - probably not.
I strongly recommend the gparted, I have resized and moved partitions
(ext2, ext3 and ntfs) with it,
and i never had problem with it. It hase a nice GUI and it does every
necessary steps automatically. :-)
--
Szénási István
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
` (2 preceding siblings ...)
2010-01-15 18:32 ` [gentoo-user] " Zhu Sha Zang
@ 2010-01-16 10:26 ` Alexander
2010-01-16 13:21 ` [gentoo-user] " Nikos Chantziaras
2010-01-18 8:44 ` [gentoo-user] " Mickaël Bucas
5 siblings, 0 replies; 20+ messages in thread
From: Alexander @ 2010-01-16 10:26 UTC (permalink / raw
To: gentoo-user
On Friday 15 January 2010 20:33:36 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?
>
> Jarry
>
it depends on how your drive partitioned and which FS is used. For example, if
the root disk (i.e. w/o /home and possibly /var directories) is the separate
partition with XFS file system you can use simultanious dump and restore on live
system. Not all FS has dump/restore utilities, however if it is available it
should be prefered over cp and tar and, possibly, rsync.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [gentoo-user] Re: How can I move system to new disk?
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
` (3 preceding siblings ...)
2010-01-16 10:26 ` Alexander
@ 2010-01-16 13:21 ` Nikos Chantziaras
2010-01-16 22:40 ` YoYo siska
2010-01-18 8:44 ` [gentoo-user] " Mickaël Bucas
5 siblings, 1 reply; 20+ messages in thread
From: Nikos Chantziaras @ 2010-01-16 13:21 UTC (permalink / raw
To: gentoo-user
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.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-16 9:57 ` Szénási István
@ 2010-01-16 15:59 ` ubiquitous1980
0 siblings, 0 replies; 20+ messages in thread
From: ubiquitous1980 @ 2010-01-16 15:59 UTC (permalink / raw
To: gentoo-user
Szénási István wrote:
>> It should be mentioned that if you use this method then, after running
>> parted to resize the partition(s), you will also need to resize the
>> filesystem(s) on the partition(s).
>>
>
> If I remember correctly, you're right and the resize of he filesystem required.
> Of course if you shrink the partition, first you need to resize the
> file system before the
> resizing of the partition and if you grow the partition, first you
> need to resize the partition
> before the resizing the file system. (Maybe, you should turn off the
> journalling when you
> modify an ext3 file system, but i am not sure in it)
>
>
>> This is well documented - google "resize ext3" or whatever. Not sure if this
>> is necessary using GParted - probably not.
>>
> I strongly recommend the gparted, I have resized and moved partitions
> (ext2, ext3 and ntfs) with it,
> and i never had problem with it. It hase a nice GUI and it does every
> necessary steps automatically. :-)
>
>
I did this the other day for an experiment. I used a spare partition,
and of course the partition concerned was unmounted:
dd if=/dev/sda4 of=backup.iso
then I did:
dd if=backup.iso of=/dev/sda3
I also have done a complete backup using tar to save some space.
tar cvfj backup.tar.bz2 /dev/sda4
when I decompress, I imagine I will mount the partition say /dev/sda3
and do the following
tar xvvf backup.tar.bz2
(This might be not accurate, but I hope it gives you a fair idea of
where to start)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-16 13:21 ` [gentoo-user] " Nikos Chantziaras
@ 2010-01-16 22:40 ` YoYo siska
2010-01-17 6:48 ` Nikos Chantziaras
2010-01-17 10:10 ` Neil Bothwick
0 siblings, 2 replies; 20+ messages in thread
From: YoYo siska @ 2010-01-16 22:40 UTC (permalink / raw
To: gentoo-user
On Sat, Jan 16, 2010 at 03:21:32PM +0200, Nikos Chantziaras wrote:
> 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
If you are doing it this way (on a running system with mounted
dev/proc/sys...), you can just bind-mount your current / to another
directory. That "copy" will not contain any "sub-mounts" (as if you
accessed it from a livecd), so you could just do
(mount your /mnt/new_root)
mkdir /mnt/current_root
mount -o bind / /mnt/current_root
rsync -aHAX /mnt/current_root/ /mnt/new_root/
i always remout / readonly first, for that you usually have to go to
single user, or stop most of the services and programs...
yoyo
>
> 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.
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [gentoo-user] Re: How can I move system to new disk?
2010-01-16 22:40 ` YoYo siska
@ 2010-01-17 6:48 ` Nikos Chantziaras
2010-01-17 12:20 ` YoYo siska
2010-01-17 10:10 ` Neil Bothwick
1 sibling, 1 reply; 20+ messages in thread
From: Nikos Chantziaras @ 2010-01-17 6:48 UTC (permalink / raw
To: gentoo-user
On 01/17/2010 12:40 AM, YoYo siska wrote:
> On Sat, Jan 16, 2010 at 03:21:32PM +0200, Nikos Chantziaras wrote:
>> On 01/15/2010 07:33 PM, Jarry wrote:
>> [...]
>> 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.
>> [...]
>
> If you are doing it this way (on a running system with mounted
> dev/proc/sys...), you can just bind-mount your current / to another
> directory. That "copy" will not contain any "sub-mounts"
rsync -ax / /target shouldn't copy any sub-mounts either, because of the
-x option. See man rsync. I mentioned it just in case ;)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-16 22:40 ` YoYo siska
2010-01-17 6:48 ` Nikos Chantziaras
@ 2010-01-17 10:10 ` Neil Bothwick
2010-01-17 21:19 ` Keith Dart
2010-01-18 9:28 ` Frank Steinmetzger
1 sibling, 2 replies; 20+ messages in thread
From: Neil Bothwick @ 2010-01-17 10:10 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
On Sat, 16 Jan 2010 23:40:44 +0100, YoYo siska wrote:
> . If you are doing it this way (on a running system with mounted
> dev/proc/sys...), you can just bind-mount your current / to another
> directory. That "copy" will not contain any "sub-mounts" (as if you
> accessed it from a livecd),
Or you could simply use the -x option with rsync. But copying an in use
filesystem is a bad idea, better to boot from a live CD and do the job
there. If you want to minimise downtime, do the rsync on the working
system then boot from the live CD and do it again. The second run should
take seconds but will make sure your disk is consistent. Remember to use
--delete on the second run.
--
Neil Bothwick
We shall shortly be landing. Please return your stewardess to
the upright position.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-17 6:48 ` Nikos Chantziaras
@ 2010-01-17 12:20 ` YoYo siska
0 siblings, 0 replies; 20+ messages in thread
From: YoYo siska @ 2010-01-17 12:20 UTC (permalink / raw
To: gentoo-user
On Sun, Jan 17, 2010 at 08:48:21AM +0200, Nikos Chantziaras wrote:
> On 01/17/2010 12:40 AM, YoYo siska wrote:
>> On Sat, Jan 16, 2010 at 03:21:32PM +0200, Nikos Chantziaras wrote:
>>> On 01/15/2010 07:33 PM, Jarry wrote:
>>> [...]
>>> 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.
>>> [...]
>>
>> If you are doing it this way (on a running system with mounted
>> dev/proc/sys...), you can just bind-mount your current / to another
>> directory. That "copy" will not contain any "sub-mounts"
>
> rsync -ax / /target shouldn't copy any sub-mounts either, because of the
> -x option. See man rsync. I mentioned it just in case ;)
>
yes, but it will miss any files "hidden" under those mounts, though
normally that menas only /dev/, the others are empty...
and i like it more, because it makes a more "exact" copy ;)
yoyo
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-17 10:10 ` Neil Bothwick
@ 2010-01-17 21:19 ` Keith Dart
2010-01-18 9:28 ` Frank Steinmetzger
1 sibling, 0 replies; 20+ messages in thread
From: Keith Dart @ 2010-01-17 21:19 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]
=== On Sun, 01/17, Neil Bothwick wrote: ===
> Or you could simply use the -x option with rsync. But copying an in
> use filesystem is a bad idea, better to boot from a live CD and do
> the job there. If you want to minimise downtime,
===
I recently did something like this. I did use the 10th anniversary live
DVD, but copied to USB stick, to perform it. :-) I like that so far,
thanks guys. The "cp -a" on the mount points worked well, also. The
tricky part for me was that the original (source) disk was once a pair
in a RAID 1 array, with LVM. The other member failed. So you also have
to start the array on the original in degraded mode and also rename
the LVM volume group name.
In the end it Gentoo live DVD is a handy tool. If you keep in on USB
stick you can also update it and add new files, like Gentoo quick
install guide. ;-)
-- Keith Dart
--
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keith Dart <keith@dartworks.biz>
public key: ID: 19017044
<http://www.dartworks.biz/>
=====================================================================
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] How can I move system to new disk?
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
` (4 preceding siblings ...)
2010-01-16 13:21 ` [gentoo-user] " Nikos Chantziaras
@ 2010-01-18 8:44 ` Mickaël Bucas
5 siblings, 0 replies; 20+ messages in thread
From: Mickaël Bucas @ 2010-01-18 8:44 UTC (permalink / raw
To: gentoo-user
2010/1/15 Jarry <mr.jarry@gmail.com>:
> 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?
>
> Jarry
>
I've done it twice with the following method :
http://www.faqs.org/docs/Linux-mini/Hard-Disk-Upgrade.html
There are a few things to change : no more Lilo, ext2, IDE, diskettes these days
But the check list is complete so you won't forget important points.
Mickaël Bucas
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Re: How can I move system to new disk?
2010-01-17 10:10 ` Neil Bothwick
2010-01-17 21:19 ` Keith Dart
@ 2010-01-18 9:28 ` Frank Steinmetzger
1 sibling, 0 replies; 20+ messages in thread
From: Frank Steinmetzger @ 2010-01-18 9:28 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]
Am Sonntag, 17. Januar 2010 schrieb Neil Bothwick:
> On Sat, 16 Jan 2010 23:40:44 +0100, YoYo siska wrote:
> > . If you are doing it this way (on a running system with mounted
> > dev/proc/sys...), you can just bind-mount your current / to another
> > directory. That "copy" will not contain any "sub-mounts" (as if you
> > accessed it from a livecd),
>
> Or you could simply use the -x option with rsync. But copying an in use
> filesystem is a bad idea, better to boot from a live CD and do the job
> there. If you want to minimise downtime, do the rsync on the working
> system then boot from the live CD and do it again. The second run should
> take seconds but will make sure your disk is consistent. Remember to use
> --delete on the second run.
I did it this exact way when I bought a new HDD for my laptop last Christmas,
because then I could still use my normal system instead of booting a LiveCD
and waiting for the sync to finish (which could take half an hour). Copying
16GB from a laptop HDD to another one via USB is not that fast. Only before
everything was done and I was ready to boot with the new HDD, I did another
rsync with logged-out users on TTY1, which takes but a minute. IIRC I didn’t
even boot a live CD.
And even IF there were some flaws in the mirrored system, there’d be no harm
done as I have the original still around to amend them.
--
Gruß | Greetings | Qapla'
Crayons can take you more places than starships. (Guinan)
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2010-01-18 9:29 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 17:33 [gentoo-user] How can I move system to new disk? Jarry
2010-01-15 17:48 ` Hazen Valliant-Saunders
2010-01-15 18:00 ` Hazen Valliant-Saunders
2010-01-15 18:09 ` Dale
2010-01-15 18:17 ` Hazen Valliant-Saunders
2010-01-15 18:18 ` [gentoo-user] " Remy Blank
2010-01-15 20:12 ` Szénási István
2010-01-15 23:11 ` Stroller
2010-01-16 9:57 ` Szénási István
2010-01-16 15:59 ` ubiquitous1980
2010-01-15 18:32 ` [gentoo-user] " Zhu Sha Zang
2010-01-16 10:26 ` Alexander
2010-01-16 13:21 ` [gentoo-user] " Nikos Chantziaras
2010-01-16 22:40 ` YoYo siska
2010-01-17 6:48 ` Nikos Chantziaras
2010-01-17 12:20 ` YoYo siska
2010-01-17 10:10 ` Neil Bothwick
2010-01-17 21:19 ` Keith Dart
2010-01-18 9:28 ` Frank Steinmetzger
2010-01-18 8:44 ` [gentoo-user] " Mickaël Bucas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox