[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Clonage



Bon on y va:
Pour faire un CD/Clef USB, tu peux le faire sur ton système ou bien à partir de la clef.
Le mécanisme est à peu près le même:

Script started on ven 15 jun 2007 21:12:06 CEST
francois@totoche:~$ su
Password: 
totoche:/home/francois# cd /root/CDiso/
totoche:~/CDiso# ls
boot.catalog  doroot		 install.debootstrap  srcroot
busybox       e2fsck_e2c.static  isolinux	      syslinux.cfg
busybox_1.gz  FaitUSB		 ldlinux.sys	      testdisk.readme
busybox.pdf   Gravure.tgz	 makecd		      Testdisk.tgz
totoche:~/CDiso# sh srcroot
136796 blocs
totoche:~/CDiso# ls
boot.catalog  e2fsck_e2c.static    ldlinux.sys	 testdisk.readme
busybox       FaitUSB		   makecd	 Testdisk.tgz
busybox_1.gz  Gravure.tgz	   Root
busybox.pdf   install.debootstrap  srcroot
doroot	      isolinux		   syslinux.cfg
totoche:~/CDiso# # ROOT est le repertoire complet, de la racine.
totoche:~/CDiso# cd /Root/root
totoche:~/CDiso/Root/root# head letsgo
head: Ne peut ouvrir `letsgo' en lecture: Aucun fichier ou rpertoire de ce type
totoche:~/CDiso/Root/root# ls
letsgo.autre  letsgo.physique
totoche:~/CDiso/Root/root# head letsgo.physique
#!/bin/sh
RESEAU=192.168.10
FICHIER=partitionsda2.gz
SERVEUR=$RESEAU".254"
fdisk /dev/sda << EOF
d
2
d
3
n
totoche:~/CDiso/Root/root# tu edites ton fichier letsgo, 
# il y a un lien /bin/letsgo vers /root/letsgo
totoche:~/CDiso/Root/root# cd ../..
totoche:~/CDiso# ls
boot.catalog  e2fsck_e2c.static    ldlinux.sys	 testdisk.readme
busybox       FaitUSB		   makecd	 Testdisk.tgz
busybox_1.gz  Gravure.tgz	   Root
busybox.pdf   install.debootstrap  srcroot
doroot	      isolinux		   syslinux.cfg
totoche:~/CDiso# sh doroot 
totoche:~/CDiso# ls -l isolinux/root26.gz 
-rwxr-xr-x 1 root root 23653586 2007-06-15 21:14 isolinux/root26.gz
totoche:~/CDiso# # la racine est refaite
totoche:~/CDiso# rm -Rf Root
totoche:~/CDiso# sh makecd
I: -input-charset not specified, using iso-8859-15 (detected in locale settings)
genisoimage 1.1.2 (Linux)
Scanning .
Excluded by match: ./boot.catalog
[..]
Done with: Directory tree                          Block(s)    2
Writing:   Directory tree cleanup                  Start Block 26
Done with: Directory tree cleanup                  Block(s)    0
Writing:   The File(s)                             Start Block 26
 35.27% done, estimate finish Fri Jun 15 21:20:00 2007
 70.38% done, estimate finish Fri Jun 15 21:20:00 2007
Total translation table size: 2048
Total rockridge attributes bytes: 0
Total directory bytes: 2048
Path table size(bytes): 26
Done with: The File(s)                             Block(s)    14043
Writing:   Ending Padblock                         Start Block 14069
Done with: Ending Padblock                         Block(s)    150
Max brk space used 0
14219 extents written (27 MB)
-rw-r--r-- 1 root root 29120512 2007-06-15 21:20 /tmp/BootCD.iso
totoche:~/CDiso# 
francois@totoche:~$ exit

Script done on ven 15 jun 2007 21:15:10 CEST

Lorsque tu as lancer la clef, une fois mont la clef (attention,
il n'y a pas udev donc faire un modprobe usb-storage avant par exemple si tu
veux accder  la clef), tu montes ta clef, tu feais un rpertoire /tmp/GRE,
tu fais
# cd /tmp/GRE
# mount /dev/sda1 /mnt
# srcroot /mnt
l a te fais ton arborescence sous /tmp/GRE
Tu fais les modifs (recopies de ton fichier que tu as dit par exemple)
Tu fais toujours sous /tmp/GRE, la clef tant monte sous /mnt
# doroot /mnt
et tu as une racine modifie. Tu peux rajout ce que tu veux.

Tu peux t'inspirer du script letsgo.physique sous /root pour voir
comment dupliquer des partitions. Je vais utiliser a pour 50 machines ce Jeudi.

François Boisson



Reply to: