最後更新: 2019-03-06
Personalize 目的
* make your own system and data recovery disk
* add your own scripts to make the recovery procedure automatic
* combining the restoration and backups software
方式
- backstore
- 修改 boot options
- sysrcd.dat
Create and use a backing store (sysrcd.bs)
A backing-store is not mandatory and if the scan fails, it will store the files which have changed in memory.
To disable the disks scan at boot time specify backstore=off on the boot command line.
If you want to save your backing-store file on a harddisk, boot with backstore=alldev to scan all devices (not just removable devices).
* default location for a backing-stores file is any file named sysrcd.bs located at the root of a disk
Create sysrcd.bs
boot SystemRescueCd with option “backstore=off”
mkdir /mnt/backstore
mount -o rw /dev/sdaX /mnt/backstore
# mega-bytes
sysresccd-backstore create /mnt/backstore/sysrcd.bs 256
dd if=/dev/zero of=/mnt/backup/sysrcd.bs bs=1024k count=256 mke2fs -j -F -b 1024 /mnt/backstore/sysrcd.bs
# when sysresccd starts again, it should automatically mount the backing-store and
# use it you can check that the backing-store file is mounted on /mnt/memory
reboot
簡易自制 ( 只修改 boot options )
1. 用 sysresccd
2. mount 起 CD 自身
mount /dev/sr0 /mnt/cd
3. 解開 CD 資料的地方, 最少要有 CD 自身的 size X 2 的空間
mount /dev/sdaN /mnt/custom
mkdir /mnt/custom/isoroot
cp -a /mnt/cd/* /mnt/custom/isoroot
cd /mnt/custom/isoroot
# 用 sysresccd-custom 自定
sysresccd-custom setkmap en
/mnt/custom is mounted -> ok Keymap to be loaded: en
# 自定 boot options
isoroot/isolinux/isolinux.cfg
# 修改 splash screen
isoroot/isolinux/f1boot.msg
# 建立 ISO
sysresccd-custom isogen my_srcd
Add files to the compressed image file(sysrcd.dat)
OS: Gentoo
sysrcd.dat <-- squashfs filesystem
1. 建立環境
mkdir /mnt/custom
mount /dev/sdaN /mnt/custom
* sdaN must linux partition
2. Extract sysrcd.dat
* At least 1.5 GB & take over 15 minutes)
* Default 係 extract 去 /mnt/custom
/usr/sbin/sysresccd-custom extract
* 建立了
- /mnt/custom/customcd/files 1.5G (syscd.dat 的內容)
- /mnt/custom/customcd/isoroot 125M
3. Chroot in the sysresccd environment
mkdir -p /mnt/custom/customcd/files/proc
mkdir -p /mnt/custom/customcd/files/dev
mkdir -p /mnt/custom/customcd/files/sys
mount -o bind /proc /mnt/custom/customcd/files/proc
mount -o bind /dev /mnt/custom/customcd/files/dev
mount -o bind /sys /mnt/custom/customcd/files/sys
chroot /mnt/custom/customcd/files /bin/bash
4. Customize
...................
5. Create the new squashfs image
/usr/sbin/sysresccd-custom squashfs
* 建立了: /mnt/custom/customcd/isoroot/sysrcd.dat
6. Add files to the ISO image
cp -a my-files /mnt/custom/customcd/isoroot
7. Last: Create the new ISO image
# my_srcd = volume name for the CDRom
sysresccd-custom isogen my_srcd
* The new ISO image is:
/mnt/custom/customcd/isofile/sysresccd-ccyymmdd-hhmm.iso
output
/mnt/custom is mounted -> ok there is enough estimated free space here (5134 MB) -> ok Volume name of the CDRom: my_srcd xorriso 1.3.8 : RockRidge filesystem manipulator, libburnia project. Drive current: -outdev 'stdio:/mnt/custom/customcd/isofile/sysresccd-20190226-0505.iso' Media current: stdio file, overwriteable Media status : is blank Media summary: 0 sessions, 0 data blocks, 0 data, 5133m free xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules Added to ISO image: directory '/'='/mnt/custom/customcd/isoroot' xorriso : UPDATE : 363 files added in 1 seconds xorriso : UPDATE : 363 files added in 1 seconds xorriso : UPDATE : 9.99% done xorriso : UPDATE : 51.63% done xorriso : UPDATE : 91.70% done ISO image produced: 63663 sectors Written to medium : 63663 sectors at LBA 0 Writing to 'stdio:/mnt/custom/customcd/isofile/sysresccd-20190226-0505.iso' completed successfully. xorriso -as mkisofs -joliet -rock -omit-version-number -disable-deep-relocation \ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot \ -o /mnt/custom/customcd/isofile/sysresccd-20190226-0505.iso \ -volid my_srcd /mnt/custom/customcd/isoroot --> 0 Final ISO image: /mnt/custom/customcd/isofile/sysresccd-20190226-0505.iso