User Tools

Site Tools


Sidebar






newpage

linux:filesystems:boot

This is an old revision of the document!


boot

linux boot process tricks

howto clone harddisc and boot new system

To get the system-files transfered, it's best to get a live USB-stick or CD and boot into it
(all live-distros from ubuntu to systemrescuecd are ok).
In a livesystem, you can mount the partitions and transfer the data anyway you like (as root user):

1. rsync needs params and data must be excluded, (but works in a running system), eg., :

rsync -a -v -z -h --perms -E -o -g  --times --compress --update --delete \
      --exclude="/proc/*" --exclude="/sys/*" --exclude="/mnt/*" --exclude="/media/*"

2. copy with “cp” (untested):

cp -afv /from/sourcesystem/* /mnt/newsys/
[ or ]
cp -ax /from/sourcesystem/* /mnt/newsys/

3. dd - can only be used, if both partitions have exactly the same size!

4. gparted

etc…



Fix fstab by mounting the new disc and editing /etc/fstab in there.
The UUIDs need to be replaced by the UUIDs of the new disc's partitions.

$ ls -l /dev/disk/by-uuid/ 

.. shows 'em all :)



Install grub2 - make the fresh harddisc bootable

it doesnt work for me to just run “grub-install /dev/sdX” (new hdd)
a complete change-root environment is required to fool grub2:

* mount dev, proc, sys into the new root / chroot:

mount -o bind /dev /mnt/newsys/dev
mount -t proc none  /mnt/newsys/proc
mount -t sysfs none /mnt/newsys/sys

* enter the new (virtual) root system:

chroot /mnt/newsys/

* now inside this future system, grub2 installer scripts will work. generate a new /boot/grub/grub.cfg and install to the MBR:

grub-install /dev/sdX
linux/filesystems/boot.1335365243.txt.gz · Last modified: 2012/04/25 16:47 by tkilla