set -e
-MASTER=127.0.0.1
MASTERPATH=/mnt/custom
NAME=$1
CLONE=/mnt/$NAME
mount /dev/$ROOT_PART $CLONE
echo "rsyncing root..."
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
+rsync -a --delete --one-file-system $MASTERPATH/ $CLONE/
echo "rsyncing home..."
mount /dev/$HOME_PART $CLONE/home
-rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
+rsync -a --delete --one-file-system --exclude=telecaster/archives/ --exclude=telecaster/trash/ --exclude=telecaster/test/ $MASTERPATH/home/ $CLONE/home/
umount $CLONE/home
echo "rsyncing var..."
mount /dev/$VAR_PART $CLONE/var
-rsync -a --delete --one-file-system $MASTER:$MASTERPATH/var/ $CLONE/var/
+rsync -a --delete --one-file-system $MASTERPATH/var/ $CLONE/var/
# CHROOT
echo $NAME > $CLONE/etc/hostname
-chroot $CLONE grub-install /dev/sda
+chroot $CLONE grub-install /dev/sdb
chroot $CLONE update-grub
umount $CLONE/sys