Ajout output dup-live-disk.sh en dry-run
This commit is contained in:
@@ -431,11 +431,44 @@ Récupérer le script sur mon [serveur gitea](https://git.bodiccea.tk/bruno/Tool
|
|||||||
### Test du script en dry run
|
### Test du script en dry run
|
||||||
Patrick: Lancer la commande `sudo ./dup-live-disk.sh --dry-run sdb |& tee /tmp/dry-run.txt`.
|
Patrick: Lancer la commande `sudo ./dup-live-disk.sh --dry-run sdb |& tee /tmp/dry-run.txt`.
|
||||||
|
|
||||||
|
Résultat :
|
||||||
|
```
|
||||||
|
br@deneb:~$ cat /tmp/dry-run.txt
|
||||||
|
found LABEL=root1 DEV=/dev/sda1 FSTYPE=ext4
|
||||||
|
found LABEL=swap1 DEV=/dev/sda5 FSTYPE=swap
|
||||||
|
found LABEL=export1 DEV=/dev/sda6 FSTYPE=ext4
|
||||||
|
rootlabel=root maybe=root2
|
||||||
|
Found destination root label: root2
|
||||||
|
Looking for [root2] label : DEV=/dev/sdb2 DISK=/dev/sdb FSTYPE=ext4
|
||||||
|
Looking for [swap2] label : DEV=/dev/sdb3 DISK=/dev/sdb FSTYPE=swap
|
||||||
|
Looking for [export2] label : DEV=/dev/sdb4 DISK=/dev/sdb FSTYPE=ext4
|
||||||
|
DEV1 DEV2 LABEL1 LABEL2 FS1 FS2 SVALID? DVALID? ROOT
|
||||||
|
/dev/sda1 /dev/sdb2 root1 root2 ext4 ext4 y y *
|
||||||
|
/dev/sda5 /dev/sdb3 swap1 swap2 swap swap n n
|
||||||
|
/dev/sda6 /dev/sdb4 export1 export2 ext4 ext4 y y
|
||||||
|
Info: Found target fstab (fstab.root2) in SRC root partition (/mnt/root1/etc).
|
||||||
|
*** Copy /mnt/root1/ to /mnt/root2 [y/n/q] ? yes
|
||||||
|
MariaDB/MySQL is inactive.
|
||||||
|
dry-run: rsync -axH --filter=dir-merge .rsync-disk-copy --delete --delete-excluded /mnt/root1/ /mnt/root2
|
||||||
|
*** Link /mnt/root2/etc/fstab.root2 to /mnt/root2/etc/fstab [y/n/q] ? yes
|
||||||
|
dry-run: ln -f /mnt/root2/etc/fstab.root2 /mnt/root2/etc/fstab
|
||||||
|
skipping label swap
|
||||||
|
*** Copy /mnt/export1/ to /mnt/export2 [y/n/q] ? yes
|
||||||
|
MariaDB/MySQL is inactive.
|
||||||
|
dry-run: rsync -axH --filter=dir-merge .rsync-disk-copy --delete --delete-excluded /mnt/export1/ /mnt/export2
|
||||||
|
*** install grub on /dev/sdb (root label: root2) [y/n/q] ? yes
|
||||||
|
installing grub on /dev/sdb...
|
||||||
|
dry-run: mount -o bind /sys /mnt/root2/sys
|
||||||
|
dry-run: mount -o bind /proc /mnt/root2/proc
|
||||||
|
dry-run: mount -o bind /dev /mnt/root2/dev
|
||||||
|
dry-run: chroot /mnt/root2 update-grub
|
||||||
|
dry-run: chroot /mnt/root2 grub-install /dev/sdb
|
||||||
|
```
|
||||||
|
|
||||||
### Recopie proprement dite
|
### Recopie proprement dite
|
||||||
Patrick: Lancer la commande `sudo dup-live-disk.sh --yes sdb` |& tee /tmp/we-go.txt.
|
Patrick: Lancer la commande `sudo dup-live-disk.sh --yes sdb |& tee /tmp/we-go.txt`
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
|
Cela donne :
|
||||||
```
|
```
|
||||||
br@deneb:~$ cat /tmp/we-go.txt
|
br@deneb:~$ cat /tmp/we-go.txt
|
||||||
found LABEL=root1 DEV=/dev/sda1 FSTYPE=ext4
|
found LABEL=root1 DEV=/dev/sda1 FSTYPE=ext4
|
||||||
@@ -454,16 +487,12 @@ Info: Found target fstab (fstab.root2) in SRC root partition (/mnt/root1/etc).
|
|||||||
*** Copy /mnt/root1/ to /mnt/root2 [y/n/q] ? yes
|
*** Copy /mnt/root1/ to /mnt/root2 [y/n/q] ? yes
|
||||||
MariaDB/MySQL is inactive.
|
MariaDB/MySQL is inactive.
|
||||||
rsync -axH --filter=dir-merge .rsync-disk-copy --delete --delete-excluded /mnt/root1/ /mnt/root2
|
rsync -axH --filter=dir-merge .rsync-disk-copy --delete --delete-excluded /mnt/root1/ /mnt/root2
|
||||||
***** rsync status=0
|
|
||||||
|
|
||||||
*** Link /mnt/root2/etc/fstab.root2 to /mnt/root2/etc/fstab [y/n/q] ? yes
|
*** Link /mnt/root2/etc/fstab.root2 to /mnt/root2/etc/fstab [y/n/q] ? yes
|
||||||
ln -f /mnt/root2/etc/fstab.root2 /mnt/root2/etc/fstab
|
ln -f /mnt/root2/etc/fstab.root2 /mnt/root2/etc/fstab
|
||||||
skipping label swap
|
skipping label swap
|
||||||
*** Copy /mnt/export1/ to /mnt/export2 [y/n/q] ? yes
|
*** Copy /mnt/export1/ to /mnt/export2 [y/n/q] ? yes
|
||||||
MariaDB/MySQL is inactive.
|
MariaDB/MySQL is inactive.
|
||||||
rsync -axH --filter=dir-merge .rsync-disk-copy --delete --delete-excluded /mnt/export1/ /mnt/export2
|
rsync -axH --filter=dir-merge .rsync-disk-copy --delete --delete-excluded /mnt/export1/ /mnt/export2
|
||||||
***** rsync status=0
|
|
||||||
|
|
||||||
*** install grub on /dev/sdb (root label: root2) [y/n/q] ? yes
|
*** install grub on /dev/sdb (root label: root2) [y/n/q] ? yes
|
||||||
installing grub on /dev/sdb...
|
installing grub on /dev/sdb...
|
||||||
mount -o bind /sys /mnt/root2/sys
|
mount -o bind /sys /mnt/root2/sys
|
||||||
@@ -489,5 +518,4 @@ Installation terminée, sans erreur.
|
|||||||
umount /mnt/root2/dev
|
umount /mnt/root2/dev
|
||||||
umount /mnt/root2/proc
|
umount /mnt/root2/proc
|
||||||
umount /mnt/root2/sys
|
umount /mnt/root2/sys
|
||||||
br@deneb:~$
|
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user