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 transfer all system files, 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 f&f 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. simple copy with “cp” (untested):

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

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

4. gparted - no ext4, only from livesystems

etc…



Fix partition-identifier UUIDs in fstab of the new system.
The UUIDs need to be replaced by the new UUIDs in /mnt/newsys/etc/fstab

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

.. shows 'em all :)



Install grub2 bootloader to the new disc - unfortunatly a complete change-root environment is required to fool grub-install:

* mount dev, proc, sys via “bind”-option 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 (/mnt/newsys) /boot/grub/grub.cfg and install to the MBR (leave out partition number):

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