Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| copy_linux_to_a_new_harddisk [04.01.2011 23:55] – Pascal Suter | copy_linux_to_a_new_harddisk [06.06.2014 10:54] (current) – Pascal Suter | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Copy Linux to a new Harddisk ====== | ====== Copy Linux to a new Harddisk ====== | ||
| + | In the following howto i assume that sda is your source drive and sdb is your target drive.. please make sure not to mix this up in your setup! also i assume that your operating system disk has three partitions, sda1 as /boot, sda2 as swap and sda3 as / | ||
| - | * stop any running services like apache, mysql etc. on the source system. | + | * stop any running services like apache, mysql etc. on the source system. or even better, boot from a live linux and work from there.. |
| * partition and format the new harddisk | * partition and format the new harddisk | ||
| - | | + | |
| - | * edit fstab and / | + | * create mountpoints |
| - | * install grub | + | mkdir / |
| - | | + | * mount source and targed partitions: < |
| - | find / | + | mount /dev/sda3 / |
| - | (if you have an own partiton for boot, you can leave boot away in the above command) | + | mount /dev/sda1 / |
| - | root (hd0,0) | + | mount /dev/sdb3 / |
| - | setup (hd0) | + | mkdir / |
| - | | + | mount /dev/sdb1 / |
| + | </ | ||
| + | * now copy the os: < | ||
| + | * edit / | ||
| + | * chroot to the target drive and install | ||
| + | mount --bind /dev/ / | ||
| + | mount --bind /sys/ / | ||
| + | mount --bind /proc/ / | ||
| + | chroot / | ||
| + | grub-install /dev/sdb | ||
| + | update-grub | ||
| + | grub | ||
| + | find / | ||
| + | root (hd0,0) | ||
| + | setup (hd0) | ||
| + | </ | ||
| + | | ||
| * reboot your system | * reboot your system | ||