User Tools

Site Tools


Sidebar






newpage

linux:filesystems:boot

This is an old revision of the document!


Bootloader

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 This shows 'em all: :)

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


Install grub2 bootloader to the new disc -
unfortunately 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:

update-grub

Install to the MBR (no partition number) of the new disc, finally:

grub-install /dev/sdX


reboot & good luck!


References:

http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive

linux/filesystems/boot.1335366898.txt.gz · Last modified: 2012/04/25 17:14 by tkilla