squashfs system multiboot from sd/usb
Hello.
For a past few days I'm struggling to create sd card with few root filesystems to choose from on boot. The idea is to convert running system to squashfs file and put it on sd card. Systems should be readonly and any additional files added later should be kept on rw partition mounted on start. Any other files should be kept in RAM and lost after reboot. So partitions should be like this: 1st - vmlinuz, kernel, grub files, os1.squash, os2.squash and so on 2nd - mounted to, for instance to /mnt/ after boot with extra files available across systems (after succeeding booting OS at all :)) For testing purposes I'm using vmware, with one HDD with centos 6.5 installed and run from it, and second HDD simulating SD card which is plugged to base OS, then unplugged and run by its own on another virtual machine. So what I do is: Rsync running system to /root/sqfs/ Code:
sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/* --exclude=/sys/* --exclude=/tmp/* --exclude=/home/* --exclude=/lost+found --exclude=/var/tmp/* --exclude=/boot/grub/* --exclude=/root/* --exclude=/var/mail/* --exclude=/var/spool/* --exclude=/media/* --exclude=/etc/fstab --exclude=/etc/mtab --exclude=/etc/hosts --exclude=/etc/shadow* --exclude=/etc/gshadow* --exclude=/root/sqfs/ --exclude=/etc/resolv.conf --exclude=/etc/hostname / sqfs/ Code:
sudo mksquashfs /root/sqfs/ /root/os1.squash -noappend creating filesystems on them Code:
mkfs.ext2 /dev/sdb1 Code:
mkdir /mnt/sq1 Code:
cp /boot/vmlinuz-2.6.32-431.el6.x86_64 /mnt/sq1/vmlinuz Code:
grub-install --no-floppy --root-directory=/mnt/sq1/ /dev/sdb1 Code:
default=0 Code:
/mnt/sq1 Code:
dracut Warning: No root device "block:/dev/mapper/live-rw" found |
Moderator Response
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of https://www.linuxquestions.org/quest...sb-4175507066/
|
All times are GMT -5. The time now is 04:20 AM. |