Code:
ubuntu@ubuntu:~/Downloads/grub-n-iso_multiboot$ ./mk-persistent-live_with_home-rw
Usage: sudo ./mk-persistent-live_with_home-rw <source.iso> <target device>
Example: sudo ./mk-persistent-live_with_home-rw ubuntu.iso /dev/sdx
This shellscript './mk-persistent-live_with_home-rw'
can create and upgrade persistent live drives with two partitions for
persistence, 'casper-rw' for system data and 'home-rw' for the home data.
It works only with iso files of Ubuntu Desktop, Ubuntu community flavours,
and maybe some linux distros and respins with the same boot structure.
Try again with the correct target device according to the list below
Press Enter to continue
MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE
loop0 iso9660 Ubuntu 18.04 LTS amd64 /cdrom 1.8G
loop1 squashfs /rofs 1.7G
loop2 squashfs /snap/core/4486 86.6M
loop3 squashfs /snap/gnome-3-26-1604/59 140M
loop4 squashfs /snap/gnome-calculator/154 1.6M
loop5 squashfs /snap/gnome-characters/69 12.2M
loop6 squashfs /snap/gnome-logs/25 21M
loop7 squashfs /snap/gnome-system-monitor/36 3.3M
OCZ-AGILITY3 sda 55.9G
|-sda1 vfat UBU1804-64 63M
|-sda2 ext4 isodevice /isodevice 2.5G
|-sda3 ext4 casper-rw 14.5G
`-sda4 ext4 home-rw /home 38.9G
Extreme sdb 14.6G
`-sdb1 vfat MY_STORAGE 14.6G
CDDVDW SN-208AB sr0 1024M
ubuntu@ubuntu:~/Downloads/grub-n-iso_multiboot$ sudo ./mk-persistent-live_with_home-rw xubuntu-18.04-core-amd64.iso /dev/sdb
'xubuntu-18.04-core-amd64.iso' is identified as the source ISO file
MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE
Extreme sdb 14.6G
`-sdb1 vfat MY_STORAGE 14.6G
Using 'grub.cfg' in the current directory
Using 'usb-pack_efi' in the current directory
-------------------------------------------------------------------------
Did you check and if necessary copy any valuable files from
the device '/dev/sdb' before re-using it as a persistent live drive?
Are ready to go ahead and overwrite '/dev/sdb'?
-------------------------------------------------------------------------
Create new system or upgrade with new iso file or quit? (c/u/q)? c
Final checkpoint Create '/dev/sdb' Are you sure? (y/n) y
512+0 records in
512+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.236252 s, 8.9 MB/s
mkfs.fat 4.1 (2017-01-24)
/dev/sdb1 has 64 heads and 32 sectors per track,
hidden sectors 0x0800;
logical sector size is 512,
using 0xf8 media descriptor, with 129024 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 1 sector per cluster.
FAT size is 993 sectors, and provides 127006 clusters.
There are 32 reserved sectors.
Volume ID is ce44440d, no volume label.
Automatic or manual selection of partition sizes
Do you want *automatic* partitioning? (y/n) y
Warning: The resulting partition is not properly aligned for best performance.
256+0 records in
256+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0248828 s, 42.1 MB/s
256+0 records in
256+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0750604 s, 14.0 MB/s
256+0 records in
256+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.21233 s, 4.9 MB/s
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: fafb8bba-c1c9-4231-942f-2c8ee1365db0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 1079933 4k blocks and 270336 inodes
Filesystem UUID: 2fc49f5f-13a4-4519-a744-951b9b140277
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 2210855 4k blocks and 553792 inodes
Filesystem UUID: a42d5db1-872a-4e88-be68-710fc4c91238
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
---------------------------------------------------------------------------
Use gparted to check (and maybe change) the partitions
---------------------------------------------------------------------------
======================
libparted : 3.2
======================
Information: You may need to update /etc/fstab.
tune2fs 1.44.1 (24-Mar-2018)
tune2fs 1.44.1 (24-Mar-2018)
tune2fs 1.44.1 (24-Mar-2018)
tune2fs 1.44.1 (24-Mar-2018)
tune2fs 1.44.1 (24-Mar-2018)
---------------------------------------------------------------------------
source=xubuntu-18.04-core-amd64.iso
---------------------------------------------------------------------------
UEFI Bootloader: Installing for i386-pc platform.
Installation finished. No error reported.
BIOS Bootloader: Installing for i386-pc platform.
Installation finished. No error reported.
Copying files ...
Archive: usb-pack_efi.zip
creating: usb-pack_efi/
creating: usb-pack_efi/EFI/
creating: usb-pack_efi/EFI/BOOT/
inflating: usb-pack_efi/EFI/BOOT/bootia32.efi
inflating: usb-pack_efi/EFI/BOOT/bootx64.efi
creating: usb-pack_efi/boot/
creating: usb-pack_efi/boot/grub/
inflating: usb-pack_efi/boot/grub/grub.cfg
inflating: usb-pack_efi/boot/grub/menu.lst
creating: usb-pack_efi/boot/grub4dos/
inflating: usb-pack_efi/boot/grub4dos/g2ldr
inflating: usb-pack_efi/boot/grub4dos/grub.exe
creating: usb-pack_efi/boot/memtest/
inflating: usb-pack_efi/boot/memtest/memtest.bin
inflating: usb-pack_efi/boot/memtest/memtest86+-5.01.bin
creating: usb-pack_efi/iso/
sending incremental file list
./
EFI/
EFI/BOOT/
EFI/BOOT/bootia32.efi
EFI/BOOT/bootx64.efi
boot/
boot/grub/
boot/grub/menu.lst
boot/grub4dos/
boot/grub4dos/g2ldr
boot/grub4dos/grub.exe
boot/memtest/
boot/memtest/memtest.bin
boot/memtest/memtest86+-5.01.bin
sent 2,311,429 bytes received 188 bytes 4,623,234.00 bytes/sec
total size is 2,310,239 speedup is 1.00
mount: /tmp/looper: WARNING: device write-protected, mounted read-only.
rm: cannot remove '/tmp/isotrg/*.iso': No such file or directory
< xubuntu-18.04-core-amd64.iso pv > /tmp/isotrg/xubuntu-18.04-core-amd64.iso
663MiB 0:00:01 [ 350MiB/s] [=============================================================================>] 100%
Syncing the target device ...
MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE
Extreme sdb 14.6G
|-sdb1 vfat XUB1804CORE 63M
|-sdb2 ext4 isodevice 2G
|-sdb3 ext4 casper-rw 4.1G
`-sdb4 ext4 home-rw 8.4G
The target device is ready to use.
'xubuntu-18.04-core-amd64.iso' was installed
ubuntu@ubuntu:~/Downloads/grub-n-iso_multiboot$
Bookmarks