]> git.parisson.com Git - telecaster-cloning.git/commitdiff
fix fstab edit for new clones
authorroot <root@wm22.parisson.org>
Mon, 2 Jul 2012 09:44:19 +0000 (11:44 +0200)
committerroot <root@wm22.parisson.org>
Mon, 2 Jul 2012 09:44:19 +0000 (11:44 +0200)
bin/tc_clone.sh [deleted file]
bin/tc_clone_pxe.sh [new file with mode: 0755]
bin/tc_clone_pxe_s10.sh [new file with mode: 0755]

diff --git a/bin/tc_clone.sh b/bin/tc_clone.sh
deleted file mode 100755 (executable)
index d209352..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-set -e
-
-CLONE=/mnt/custom/root
-
-sfdisk -d /dev/sda | sfdisk /dev/sdb
-ls /dev/sd*
-
-mkfs.ext4 /dev/sdb1 
-mkfs.ext4 /dev/sdb2
-mkfs.ext4 /dev/sdb5
-mkswap /dev/sdb6
-
-mount /dev/sdb1 $CLONE
-df
-
-rsync -a --one-file-system / $CLONE/
-
-mount /dev/sdb2 $CLONE/home
-mount /dev/sdb5 $CLONE/var
-df
-
-rsync -a /home/ $CLONE/home/
-rsync -a /var/ $CLONE/var/
-
-mount -t proc none $CLONE/proc
-mount -o bind /dev $CLONE/dev
-mount -o bind /sys $CLONE/sys
-
-chroot $CLONE
-
-umount $CLONE/sys
-umount $CLONE/proc
-umount $CLONE/dev
-umount $CLONE/var
-umount $CLONE/home
-umount $CLONE
-
-echo "OK, I'm cloned!"
-
diff --git a/bin/tc_clone_pxe.sh b/bin/tc_clone_pxe.sh
new file mode 100755 (executable)
index 0000000..5aad12d
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.64
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+# CLONING
+mount /dev/sda1 $CLONE
+#df
+echo "rsyncing root..."
+rsync -a --delete --one-file-system $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/sda2 $CLONE/home
+#df
+rsync -a --exclude=/home/telecaster/archives/ --exclude=/home/telecaster/trash/ --exclude=/home/telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+mount /dev/sda5 $CLONE/var
+#df
+rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+umount $CLONE/var
+umount $CLONE
+#df
+
+echo "Hello world, I'm an NEW TC clone ! :)"
+
diff --git a/bin/tc_clone_pxe_s10.sh b/bin/tc_clone_pxe_s10.sh
new file mode 100755 (executable)
index 0000000..ca9bab7
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+set -e
+
+MASTER=192.168.0.64
+MASTERPATH=/mnt/custom
+NAME=$1
+CLONE=/mnt/$NAME
+
+if [ ! -d $CLONE ]; then
+ mkdir $CLONE
+fi
+
+mount /dev/sda1 $CLONE
+echo "rsyncing root..."
+rsync -a --delete $MASTER:$MASTERPATH/ $CLONE/
+
+echo "rsyncing home..."
+mount /dev/sda3 $CLONE/home
+rsync -a --delete --exclude=/home/telecaster/archives/ --exclude=/home/telecaster/trash/ --exclude=/home/telecaster/test/ $MASTER:$MASTERPATH/home/ $CLONE/home/
+umount $CLONE/home
+
+echo "rsyncing var..."
+rsync -a --delete $MASTER:$MASTERPATH/var/ $CLONE/var/
+
+# CHROOT
+mount -t proc none $CLONE/proc
+mount -o bind /dev $CLONE/dev
+mount -o bind /sys $CLONE/sys
+
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE ls -tl /dev/disk/by-uuid >> /etc/fstab
+chroot $CLONE vi /etc/fstab
+chroot $CLONE grub-install /dev/sda
+chroot $CLONE update-grub
+
+umount $CLONE/sys
+umount $CLONE/dev
+umount $CLONE/proc
+
+#umount $CLONE/var
+umount $CLONE
+
+echo "Hello world, I'm a NEW TC (s10) clone ! :)\nDon't forget to update /etc/fstab in the chroot !"
+
+