Linux livedvd copied to hd partition, booting close to installed.
Just to put the info out there.............
Wow. I may have done something here.
I installed Zorin 3.1 on a separate partition. The zorin is updated as
best I know how. It reached 4.5 GB in size. Did a backup (tar) of my
home directory to my Common_Store partition.
Ran Remastersys to create an install iso. Excluded /cdrom/* /dev/* /media/*
/proc/* /sys/* and /tmp/*. I also excluded the symlink to my Common_Store
partition. Common_Store partition was also designated as Remastersys'
destination. (Remastersys probably excludes it's working directory,
but my Common_Store partition is 350GB. It'd run me out of disk space if it
wasn't excluded. Happened to me last year.) Created an iso for distribution.
I made a directory folder /livecd on ROOT (/), did a
# sudo mount [path to/and iso] /livecd -o loop
Made directory for destination,
# mkdir /tmp/target ## mounted destination partition on it,
# sudo mount /dev/[partition] /tmp/tartget ## changed into /livecd
# cd /livecd ## and copied the iso to it.
# sudo cp -rv .[a-zA-Z0-9_]* /tmp/target/
# sudo cp -rv [a-zA-Z0-9_]* /tmp/target/
* Thanks go to Qqmike's documentation on kubuntuforums for posting these cp lines.
I then made a custom addition to /etc/grub.d as follows ( I'm using GRUB2 )
cat /etc/grub.d/25_custom (output is):
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "sdaX Live Image w/ Persistence" {
insmod ext2
set root='(hd0,X)'
search --no-floppy --fs-uuid --set XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
linux /casper/vmlinuz --no-floppy file=/cdrom/preseed/custom.seed boot=casper ramdisk_size=1048576 root=/dev/ram rw persistent
initrd /casper/initrd.gz
}
menuentry "sdaX Live Image (Recovery Mode) w/ Persistence" {
insmod ext2
set root='(hd0,X)'
search --no-floppy --fs-uuid --set XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
linux /casper/vmlinuz --no-floppy file=/cdrom/preseed/custom.seed boot=casper ramdisk_size=1048576 root=/dev/ram rw persistent single
initrd /casper/initrd.gz
}
menuentry "sdaX ***DON'T***INSTALL*** Live Start or Install" {
insmod ext2
set root='(hd0,X)'
search --no-floppy --fs-uuid --set XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
linux /casper/vmlinuz --no-floppy file=/cdrom/preseed/custom.seed boot=casper ramdisk_size=1048576 root=/dev/ram rw --
initrd /casper/initrd.gz
}
(I X'd out partition block id and uuids. Credit also goes to Qqmike for part of this.)
-- edit-- I'm adding, This 25_custom file needs to be executable.
25_custom created so it runs before os_prober and puts GRUB line for it above MS.
Then did a
# sudo update-grub
I also made a partition for persitent storage with explicit label 'casper-rw' .
# sudo mkfs.ext3 -L casper-rw /dev/sdaXX
On 1st boot of it with persistence, I opened a terminal and sudo su'd to set password.
#(@ terminal)
# sudo su
# passwd root
#
# exit
Then rebooted to recovery mode. Entered root login. Added my own user name copying
user 'live's home directory. Had to first make a group for my user.
# groupadd -g 1000 [my user name]
# useradd -g 1000 -k /home/live -m -s /bin/bash -u 1000 [my user name]
Did a 'id live' to display live's groups something like
uid=999(live) gid=999(live) groups=999(live),[some#]([somegroup]),[some#]([somegroup]), etc...
I used usermod to match groups.
# usermod -G [some#],[some#], ... [some#] -a [my user name]
(-a option appends, without, I think it drops previous groups. I don't know what happens
if same name group id 1000 gets dropped. It might not let it happen.)
Set [my user name]'s password. ( # passwd [my user name] # )
Anyway I also edited the file /etc/gdm/custom.conf and changed the line
AutomaticLogin=live to AutomaticLogin=[my user name]
Changed into my /home/[my user name] ( # cd /home/[my user name] # )
and extracted my saved (tarred) [my user name].tgz into it.
On reboot into live with persistent its worked. The only note is that the livecd's
user 'live' is auto logged in on all the available tty's. But [my user name] auto logs on
to X-session and everything appears to be working.
The original install of 4.5 GB is now sitting on a total of 2GB.
Thats total of the live partition + casper-rw partition. What this means is,....
This won't work for multiple live partitions, cause if they try to point to the same
casper-rw partition they will bork each others settings. The one exception known to me
is AV Linux which uses a persitent partition labled live-rw. But I won't use it cause
it auto-mounts all partitions at boot. I think that's a bad idea, personally.
Last edited by a-relieved-pup-here; 12-14-2012 at 08:24 PM.
|