View Full Version : How to make a live CD/DVD from your harddisk installation
TeamXlink
September 19th, 2010, 05:23 PM
I'm confused with the optional part in Step B.
I'm trying to create a live cd of my server because I need that hard drive for something else.
My server files are all in my users home directory there is also a script in my home directory called from my rc.local file.
I don't understand what you mean by home settings.
Do I just leave out the exclude home part in the command before that?
Also, I'm doing this on a Ubuntu 8.04 Cli install.
Thank you.
EDIT:
I think I might have gotten it to work.
I did this:
QUAKE3='Quake3 .bashrc'
Then this:
cd ~ && for i in $QUAKE3
do
sudo cp -rpv --parents $i ${WORK}/rootfs/etc/skel
done
I'm unsure if this was correct or not.
Thank you.
EDIT 2:
You said this:
(Optional Step)Install any packages you want to be in the CD.
Does this mean by existing packages won't be on my cd?
Thank you.
GeoMX
September 20th, 2010, 12:46 PM
I have one more question. I can not directly modify the default LiveCD user because it is created at boot time, how can I indicate a script to be executed when the LiveCD session starts?
Nevermind, I solved it, thanks again for this HowTo :).
rubal
September 21st, 2010, 03:57 AM
i had js followed the complete steps for ubuntu10.04 and they got completed successfully..bt when i tried it in virtual box it had given me
(initramfs) mount: mounting aufs on /root failed: No such device
aufs mount failed
what should i do now..i dont hav any idea..m a newie:(
plzzz help..:(
grasmaaier
November 22nd, 2010, 10:48 AM
Dear all,
This tutorial has helped me a lot. I just create a working LiveCD with rdesktop.
But the network configuration "/etc/network/interfaces" on the livecd is removed.
How can I keep the network settings without loosing it?
Because the livecd does support wireless network and the livecd must take a specific wireless network created by myself.
Yours,
Jarl
mirix
November 28th, 2010, 02:04 PM
Hello,
I am using Debian Squeeze and I would like to keep the existing user with all the configurations files and data.
This could be useful for making an installable backup. However, in this case I would like to preserve a customized Wine installation and configuration and all the Windows programs installed. It is important that the user name remains the same.
Could you please, give me some hints on how to do this?
I have already done it with Remastersys, however, the Debian version of the Remastersys installer is rather buggy and rudimentary at this time.
Best regards,
Mirix
rutharanga
December 3rd, 2010, 09:02 AM
Thanks a lot dude..
I have tried this and successfully created my own bootable ubuntu live CD.
This is one of the best tutorials i have refered coz presentation of the idea is so clear and not ambiguous.
thnx.. :):)
Rgrdz,
Ruwan Wickramarachchi.
rutharanga
December 4th, 2010, 12:21 AM
I have created ubuntu liveCD using this tutorial and it was successful.
I also have installed ubuntu installer packages when I create my Live CD.
Can u please give me the menu.lst entry to access ubuntu installer (Title like: "Install ubuntu on your computer")
soundworks
January 3rd, 2011, 04:28 PM
Hi,
my aim is to create a live Desktop cd with following features:
no autologin,
users can only login with password.
What I have to do to remove autologin?
I read this whole thread, and just figured out that I have to use init-ramfs instead of casper as capink postet here: http://ubuntuforums.org/showthread.php?t=688872&highlight=live+cd&page=17
It would be very nice if anyone can just say me how to do this.
Thanks in advance.
farmerjohn73
February 17th, 2011, 02:23 AM
It woked for me in the 3rd attempt. I hope it works as capink said.
Thanks capink :)
jadeye
April 9th, 2011, 05:08 PM
Hey capink and everyon,
I have tried this and had problems withit,
I wish to succeed so I am asking you to look at my post:
http://ubuntuforums.org/showthread.php?p=10657607#post10657607
And tell me if I can do this at all???? maybe I am trying in vain.
Thanx.;)
prohp
April 11th, 2011, 07:13 AM
Thanks for this tutorial! help me a lot!
just want to share with you how to create live-usb instead of cd/dvd
1. insert your dok, and create a new partition
fdisk /dev/sd<b>
1. hit n for new partition
2. hit p for primary partition
3. select partition number (1)
4. leave first & last cylinder as default (just hit enter)
5. hit a to set bootable flag and choose your partition numer (section 3)
6. hit w to write parition table.
2. format partition to ext3 filesystem.
mkfs.ext3 -L LiveUSB /dev/sd<b><1>
3. mount your .iso (that you previously created) and your ext3 partition.
mkdir iso
mkdir liveusb
mount -o loop /path/to/your.iso iso
mount /dev/sd<b><1> liveusb
4. copy iso content to your dok
cp -r iso/* liveusb/
5. copy some grub files to your dok
cp -r /usr/lib/grub/i386-pc/{e2fs_stage1_5,stage1,stage2} liveusb/boot/grub
6. create grub boot loader
grub
-> device (hd2) /dev/sd<b>
-> root (hd2,0)
-> setup (hd2)
-> quit
7. umount your iso file and your dok
umount liveusb
umount iso
rm -rf iso liveusb
That's it!
just set your bios to boot from usb and you're done :)
GeoMX
April 11th, 2011, 11:34 AM
prohp: thanks for sharing, unfortunately I'm not able to try it on a Lucid installation since I can't find the files you mentioned. Should I try a previous version?
-------------------------------
edit:
I tried on a Karmic install and followed your instructions using two USB sticks, one is working fine, I have to check what the problem may be with the other, but anyway, thanks a lot for the information :).
prohp
April 12th, 2011, 02:05 AM
I forgot to mention that I test this only with Ubuntu 10.10 (Maverick).
Anyway, try to find those file with:
find / -name 'e2fs_stage1_5'
joshj70
April 17th, 2011, 03:56 PM
Hi, I am trying to make a live cd out of my Maverick and everything works fine until I get to install casper xresprobe
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
localechooser-data user-setup
The following NEW packages will be installed:
casper localechooser-data user-setup xresprobe
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 277kB of archives.
After this operation, 1061kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://us.archive.ubuntu.com/ubuntu/ maverick/main localechooser-data all 2.12ubuntu3 [26.4kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ maverick/universe xresprobe i386 0.4.24ubuntu9 [19.6kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ maverick/main user-setup all 1.28ubuntu10 [152kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ maverick-updates/main casper i386 1.248.1 [79.0kB]
Fetched 277kB in 3s (69.7kB/s)
Preconfiguring packages ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously deselected package localechooser-data.
(Reading database ... 123350 files and directories currently installed.)
Unpacking localechooser-data (from .../localechooser-data_2.12ubuntu3_all.deb) ...
it just hangs here, its been going for over an hour with no progress, please help.
lazerz
April 21st, 2011, 04:22 PM
Well em kinda stuck on step B where commands says something like
sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/*\
--exclude=/sys/* --exclude=/tmp/* --exclude=/home/*\
--exclude=/lost+found / ${WORK}/rootfs
Im on this command for like more than 2 hours now? My vm running ubuntu is just 3 gb hard-disk space of 9.0 gb allocated? Is this behavior fine when will the new file-system be prepared...
connect2jan
April 23rd, 2011, 07:32 AM
hi capink (http://ubuntuforums.org/member.php?u=200206)
exellent tutorial
i have small doubt at step A
Replace only the values highlighted in Magenta.
WHAT VALUES?
i have to use only dir names (not numaricals)right?
Mooty
May 1st, 2011, 04:45 PM
@joshj70
Going by your log, it looks like /dev/pts wasn't mounted.
Did you try https://help.ubuntu.com/community/LiveCDCustomization#Prepare%20and%20chroot
When I tried making a livecd, I never saw this thread, and used what's at that link, and worked fine.
connect2jan
May 3rd, 2011, 05:38 AM
hi (http://ubuntuforums.org/member.php?u=200206)capink (http://ubuntuforums.org/member.php?u=200206)
i done that steps A,B,C,D -without debootstrap
so in home directory
cd dir(<inthat boot dir,casper dir,md5sum.txt )were there
2)then i make that (in /home) cd 'dir to img file(.iso file),so using this .iso file i made usb drive to booable
so when i boot from usb
on screen below message
NO DEFAULT or UI configaration directory found?
boot:
when i try in google regarding this you have to rename isolinux to syslinux
but in that cd dir there is no isolinux dir?
whats wrong
plz any help
am i miss something
thanks
Omar.Fayyad
June 11th, 2011, 09:23 AM
Backtrack4 R2 installation
I finally installed backtrack4 r2 on my virtual hard disk(Virtual Box) and i found unexpectedly that i dont have any permission to write to any file or even to create one and i dont know why ...... could you help out!!!
Appreciate the support.
capink
June 15th, 2011, 09:20 AM
First, I apologize for not answering people questions. I've been busy lately and did not have much time.
I updated the guide to support grub2 instead of grub-legacy. I also added instructions for how to boot the ISO from a flash disk instead of a CD/DVD.
This will probably be the last update to the guide. Again I'm sorry for the lack of support.
Darin722
June 27th, 2011, 06:21 AM
Great tutorial!
I'm having an issue with login on the live cd though. It asks for a login. My specific details...
I'm trying to create a live cd of ubuntu 10.10 from an installation in virtual box.
can anyone suggest how I can fix/troubleshoot this?
I've followed the tutorial as presented on the first page successfully, except that I had to add grep -v rootfs /proc/mounts > /etc/mtab just before installing casper to fix an error. df: warning:cannot read table of mounted filesystems:no such file or directory
edit:
I've noticed that even though I removed users with uid's greater than 999 from /etc/passwd (and copied /etc/passwd over /etc/passwd-) when I run the command sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} it reports the deleted users, rather it reports users from the /etc/passwd file of the host, not the one from which the users were deleted.
Number of ids (unique uids + gids) 32
Number of uids 12
root (0)
daemon (1)
couchdb (105)
gdm (113)
ubuntu (1000)
speech-dispatcher (107)
libuuid (100)
syslog (101)
unknown (997)
test (1001)
man (6)
avahi-autoipd (103)
Here 'ubuntu' is the host system user I'm working as. I created the user "test" on the host system after removing all users from the /etc/passwd file for the live cd, just before creating the squashfs. So why is mksquashfs reporting findings from the hosts /etc/passwd file, and is this why the live cd is prompting me for a login?
capink
June 27th, 2011, 11:56 AM
Be sure you have done step C.5. Also be sure you successfully umounted ${WORK}/rootfs/{dev,proc,sys}.
Please give me the output of the following commands:
sudo cat ${WORK}/rootfs/etc/passwd
sudo ls sudo cat ${WORK}/rootfs/dev
sudo ls ${WORK}/rootfs/proc
sudo ls ${WORK}/rootfs/sys
Also it won't hurt to delete those files before making the squashfs image
sudo rm ${WORK}/rootfs/etc/mtab
sudo rm ${WORK}/rootfs/etc/passwd-
it reports users from the /etc/passwd file of the host, not the one from which the users were deleted.
That is normal.
Darin722
June 27th, 2011, 04:27 PM
Thanks for the quick reply Capink! You helpful folks in the linux community are one of the reasons I'm such a huge fan of the OS!
Ok, Following the tutorial as written: after unmounting, just before making squashfs in step D.4. The outputs you requested.
ubuntu@lcd1:~$ sudo cat ${WORK}/rootfs/etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
syslog:x:101:103::/home/syslog:/bin/false
messagebus:x:102:105::/var/run/dbus:/bin/false
avahi-autoipd:x:103:108:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false
avahi:x:104:109:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
couchdb:x:105:113:CouchDB Administrator,,,:/var/lib/couchdb:/bin/bash
usbmux:x:106:46:usbmux daemon,,,:/home/usbmux:/bin/false
speech-dispatcher:x:107:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
kernoops:x:108:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
pulse:x:109:114:PulseAudio daemon,,,:/var/run/pulse:/bin/false
rtkit:x:110:117:RealtimeKit,,,:/proc:/bin/false
saned:x:111:118::/home/saned:/bin/false
hplip:x:112:7:HPLIP system user,,,:/var/run/hplip:/bin/false
gdm:x:113:120:Gnome Display Manager:/var/lib/gdm:/bin/false
vboxadd:x:999:1::/var/run/vboxadd:/bin/false
ubuntu@lcd1:~$
ubuntu@lcd1:~$ sudo ls sudo cat ${WORK}/rootfs/dev
ls: cannot access sudo: No such file or directory
ls: cannot access cat: No such file or directory
/home/ubuntu/work/rootfs/dev:
ubuntu@lcd1:~$
ubuntu@lcd1:~$ sudo ls sudo cat ${WORK}/rootfs/dev
ls: cannot access sudo: No such file or directory
ls: cannot access cat: No such file or directory
/home/ubuntu/work/rootfs/dev:
ubuntu@lcd1:~$ sudo ls ${WORK}/rootfs/proc
ubuntu@lcd1:~$
ubuntu@lcd1:~$ sudo ls ${WORK}/rootfs/sys
ubuntu@lcd1:~$
On a side note: after creating the squashfs I mounted it to have a look at /etc/passwd. It does indeed have all the users from the original host's passwd file rather than the trimmed version.
Darin722
June 27th, 2011, 05:03 PM
Hm. I seem to have confused myself along the way somewhere. I just mounted the live-cd.iso and the filesystem.squashfs and looked at /etc/passwd again. There are no users with uid's greater than 999. When I start the iso in virtualbox though it still asks for a login.
capink
June 27th, 2011, 06:05 PM
I think I know what is wrong there. Your /etc/passwd shows a user with an id 999 which is strange. Have you set that user manually. Anyway, we have to remove that user because id 999 is preserved for the live cd user. I updated thed guide to guard against this happening for anyone else.
You don't have to start over if you have not cleaned your workspace (the optional step D.3). Do the following:
export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper
replace the values in Magenta with the exact same values you used in your previous attempt.
chroot into the rootfs evn
sudo chroot ${WORK}/rootfs /bin/bash
Remove non system users (including uid 999)
for i in `cat /etc/passwd | awk -F":" '{print $1}'`
do
uid=`cat /etc/passwd | grep "^${i}:" | awk -F":" '{print $3}'`
[ "$uid" -gt "998" -a "$uid" -ne "65534" ] && userdel --force ${i} 2>/dev/null
done
Now, exit the chroot
exit
resume the steps of the guide at step D.4
Darin722
June 27th, 2011, 08:54 PM
Thanks! That did the trick!
You've really helped my project along and helped open up a new playground of creating custom CDs :)
The user with the uid of 999 was created by virtualbox when I installed the guest addins.
pathakvirendra
July 12th, 2011, 12:00 PM
Hello I followed the step and at last iso image was formed. But when I boot from virtualbox I get hang up on
(initramfs) terminal with the error
" mount : mounting aufs on root failed : No such device
aufs mount failed "
I am using ubuntu 10.10. Looking for help !!!!
rajesh.kalapura
July 14th, 2011, 04:36 AM
Hello I followed the step and at last iso image was formed. But when I boot from virtualbox I get hang up on
(initramfs) terminal with the error
" mount : mounting aufs on root failed : No such device
aufs mount failed "
I am using ubuntu 10.10. Looking for help !!!!
I had also same problem with remastered cd of Ubuntu Natty. Recompiling the Natty kernel with aufs2 is the only fix for this.Anyway I have successfully recompiled kernel with aufs2 and now it booted successfully.Thank you capink,for such a nice tutorial.:P:P:P
mbah.pande
August 2nd, 2011, 05:26 AM
what a good post :KS
i tried to make my own LiveDVD from natty with this tutorial but stuck in this when installing casper at chroot
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.0.0-7-generic
df: Warning: cannot read table of mounted file systems: No such file or directory
cryptsetup: WARNING: could not determine root device from /etc/fstab
how to resolve this error? ](*,)
capink
August 2nd, 2011, 02:52 PM
That error will not affect the end result. Continue the rest of the guide. It is not an error anyway, it just a warning. Most probably it is caused by the absence of mtab file in the chroot environment. As I said, this should not affect the process of creating a live CD.
jaakw
August 6th, 2011, 03:36 AM
Hellow
I used this script to make my customized live DVD. On harddisk I made some modifications. Install smart card reader and some specific software. Among other things I install network printer (ower printserver). Printer works if I boot from HDD. If I test the iso then there is not printer in the system. Printer miss on the DVD to. Other modifications are OK. Smart card reader works and software is OK.
What must I do different that the printer will work on live DVD?
Regards
Jaak
capink
August 6th, 2011, 06:59 AM
I don't know why your printer is not appearing. I guess the reason is that some files that are necessary for you printer to work are installed to your home directory. You have to identify these files and copy them to the /etc/skel in the live CD.
jaakw
August 6th, 2011, 09:54 AM
I don't know why your printer is not appearing. I guess the reason is that some files that are necessary for you printer to work are installed to your home directory. You have to identify these files and copy them to the /etc/skel in the live CD.
I installed the system as user administrator. In what directory must I search the files?
/home/administrator/
or
/root/
Files that I can assosiate with printing is situated in /etc/cups directory. What kind of files must I find more?
Regards,
Jaak
grubu
August 22nd, 2011, 04:47 PM
Building the live media from scratch using debootstrap.
Instead of using your current installation to be the basis of you live CD, you can build a custom clean system from scratch using, and then use that as the basis of your CD. The modifications you have to make are:
Update 1: This guide is updated to use grub2 instead of grub-legacy
These are instructions for people who want a live CD containing a clean system (or a minimal rescue disc), you can build a new custom Ubuntu from scratch using debootstarp, and then apply the steps of the guide to make a live cd out of it. These are the steps for people who wish to build a custom system from scratch, instead of using their harddrive installation as a basis.
Outline of the steps:
A. Prepare Our work environment.
B. Copy the Source system to the target directory.
C. Chroot into the new system and make some modifications.
D. Prepare The CD directory tree.
E. Build the CD/DVD
Appendix 1. Building the live media form scratch using Debootstrap.
Conventions used in this HOWTO:
Text highlighted in Magenta is meant to be replaced by the user's custom value. e.g. I will use gedit as my default text editor. Replace gedit with your favorite text editor.
Commands performed within a chroot will be in Blue.
Optional arguments or steps will be highlighted in Gray.
A. Preparing the environment
1. Set some variables
export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casperThe WORK Directory is where our temporary files and mount point will reside.
The CD is the location of the CD tree.
FORMAT is the filesystem type. We you are going to use a compressed squashfs.
FS_DIR is the location of the actual filesystem image within the cd tree.
Replace only the values highlighted in Magenta.
2. Create the CD and the WORK directory structure:
sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs3. Install some packages on your current system:
sudo apt-get updatesudo apt-get install grub2 xorriso squashfs-tools qemuqemu is optional. It is only needed for testing the cd before burning it. It can be substituted with any other virtualization software like virtualbox.
B. Build a custom system from scratch using debootstrap
1. Install debootstrap
sudo apt-get install debootstrap2. Run debootstrap to install the basic packages:
sudo debootstrap natty ${WORK}/rootfsReplace natty with any other version you want (e.g. maverick, lucid, .....)
This step will take time as the deb files are downloaded.
Now you have a system the contain the basic packages. At this stage this system can only work as chroot system. But in the next steps we will modify it to be full system.
3. Prepare the new system before chrooting into it:
Modify the new system sources list:
sudo gedit ${WORK}/rootfs/etc/apt/sources.listAnd place the following text into it:
deb http://archive.ubuntu.com/ubuntu/ natty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ natty main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu natty-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu natty-security main restricted universe multiverse
deb http://packages.medibuntu.org/ natty free non-free
Note: Replace natty with your favorite version name. e.g. maverick
Copy the following files to have internet access within the chroot environment:
for i in /etc/resolv.conf /etc/hosts /etc/hostname; do sudo cp -pv $i ${WORK}/rootfs/etc/; doneC. Chroot into the new system and modify it:
4. Chroot into the new system:
sudo mount --bind /dev ${WORK}/rootfs/devsudo mount -t proc proc ${WORK}/rootfs/procsudo mount -t sysfs sysfs ${WORK}/rootfs/syssudo mount -t devpts devpts ${WORK}/rootfs/dev/ptssudo chroot ${WORK}/rootfs /bin/bashNote: All commands in blue are run within chroot.
LANG=5. Once in chroot, modify the new system:
apt-get update --allow-unauthenticatedThis will give you GPG warning because of third party repositories (Codecs repositories). Ignore it and proceed.
6. Install the multimedia repository keyrings ( to prevent apt from complaining about missing GPG ):
apt-get -qq install wget && wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | apt-key add -7. Install some important packages not included in the base install performed by debootstrap, most notably is the kernel:
apt-get install linux-generic linux-headers-generic ubuntu-minimal ubuntu-standardNow, we have a complete command line system
8. To have a GUI system, install:
apt-get install xorg gdm openbox fbpanel thunar firefox mplayer w32codecs scite gqview xarchiver rxvt gtk2-engines xcursor-themes ttf-bitstream-vera ttf-dejavu ttf-freefontxorg in necessary for a GUI.
Replace openbox with your favorite window manager.
Replace gdm with your favorite login manager. (Or you can do without login manager and user startx if you want)
The rest is optional. You can ignore them or replace them with your favorite programs. if you are a gnome fan you can install gnome-core. kde fans can install kde. xfce fans can install xfce4 ......
Note: If you want to build a system identical to official ubuntu replace all the packages above with just one metapackage called ubuntu-desktop (kubuntu-desktop for kubuntu, xubuntu-desktop for xubuntu)
By now you have built a complete GUI system.
9. Install Packages Essential for live CD:
apt-get updateapt-get install caspercasper contain the live scirpts.
discover1 & xresprobe are used for autodetectin hardware at startup.
3. (Optional) If you want your live cd to have an installer, install the Ubuntu installer:
apt-get install ubiquity ubiquity-frontend-gtkNote: People using kde replace replace the previous command with
apt-get install ubiquity ubiquity-frontend-kde(Optional Step)Install any packages you want to be in the CD. Some of the following packages are useful in emergency situations:
sudo apt-get install gparted ms-sys testdisk wipe partimage xfsprogs reiserfsprogs jfsutils ntfs-3g ntfsprogs dosfstools mtoolsgparted: patitioning tool. It is automatically installed as a dependecy of ubiquity.
testdisk: Partition scanner and disk recovery tool.
wipe: Secure file deletion.
partimage: backup partitions into a compressed image file (like norton ghost).
xfsprogs reiserfsprogs jfsutils: Tools for handling different filesystems.
mtools: Tools for manipulating MSDOS files
10. Update the initramfs:
Set the kernel version of the chroot env:
export kversion=`cd /boot && ls -1 vmlinuz-* | tail -1 | sed 's@vmlinuz-@@'`First update modules.dep:
depmod -a $(uname -r)Update the initrd
update-initramfs -u -k $kversionAs already metioned above, the initramfs is reponsible for much of the preparation required at the boot time of the CD/DVD. The updated initramfs now contain the live scirpts installed with casper.
11. Clean apt cache
apt-get clean12. Clean some dirs and files:
rm /etc/resolv.confrm /etc/hostname13. Exit chroot
exit
D. Prepare The CD directory tree:
1. Copy the kernel, the updated initrd and memtest prepared in the chroot:
export kversion=`cd ${WORK}/rootfs/boot && ls -1 vmlinuz-* | tail -1 | sed 's@vmlinuz-@@'`sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-${kversion} ${CD}/boot/vmlinuzsudo cp -vp ${WORK}/rootfs/boot/initrd.img-${kversion} ${CD}/boot/initrd.imgsudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot2. Generate manifest:
Note: This step is only needed if you installed the Ubuntu installer ubiquity. This step generates two files (filesystem.manifest & filesystem.manifest-desktop).
sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}/filesystem.manifestsudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}REMOVE='ubiquity casper user-setup os-prober libdebian-installer4'for i in $REMOVE
do
sudo sed -i "/${i}/d" ${CD}/${FS_DIR}/filesystem.manifest-desktop
done
These two files are used by the ubiquity installer when installing to harddisk. These two files are just lists of packages. Ubiquity compares these two files and removes packages unique to filesystem.manifest. This way when installing to harddisk, packages like casper which is only useful in a live CD/DVD are removed. These packages that will be removed at install are defined in the variable $REMOVE
3. Unmount bind mounted dirs:
sudo umount ${WORK}/rootfs/procsudo umount ${WORK}/rootfs/syssudo umount ${WORK}/rootfs/dev/ptssudo umount ${WORK}/rootfs/dev4. Convert the directory tree into a squashfs:
sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappendNote: Make sure the resulting file size can fit into your live media.
5. Make filesystem.size
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/casper/filesystem.size6. Calculate MD5
find ${CD} -type f -print0 | xargs -0 md5sum | sed "s@${CD}@.@" | grep -v md5sum.txt |sudo tee ${CD}/md5sum.txt
7. Make Grub the bootloader of the CD
Make the grub.cfg
sudo gedit ${CD}/boot/grub/grub.cfgCopy the following text into it and save it.
set default="0"
set timeout=10
menuentry "Ubuntu GUI" {
linux /boot/vmlinuz boot=casper quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu in safe mode" {
linux /boot/vmlinuz boot=casper xforcevesa quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu CLI" {
linux /boot/vmlinuz boot=casper textonly quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu GUI persistent mode" {
linux /boot/vmlinuz boot=casper persistent quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu GUI from RAM" {
linux /boot/vmlinuz boot=casper toram quiet splash
initrd /boot/initrd.img
}
menuentry "Check Disk for Defects" {
linux /boot/vmlinuz boot=casper integrity-check quiet splash
initrd /boot/initrd.img
}
menuentry "Memory Test" {
linux16 /boot/memtest86+.bin
}
menuentry "Boot from the first hard disk" {
set root=(hd0)
chainloader +1
}E. Build the CD/DVD
1. Make the ISO file
sudo grub-mkrescue -o ~/live-cd.iso ${CD}2. Test the CD
Test using qemu emulator
qemu -cdrom ~/live-cd.iso -boot dOr use any other virtualization program you like.
Update: As noted by az (http://ubuntuforums.org/member.php?u=844) in this post (http://ubuntuforums.org/showpost.php?p=4643009&postcount=18), while testing the iso with qemu sometimes it drops you to an initramfs shell because of a problem with qemu. This behaviour has been confirmed by other users. In this case it is advisable to retest the iso with another virtualization software like virtualbox or to copy the iso to flash disk and test directly on your pc (See Appendix 2.).
3. (Optional) Clean our workspace
[ -d "$WORK" ] && rm -r $WORK $CD
Final Notes:
If you are using a custom kernel make sure it has support for the following:
Support of loopback device.
Support for squashfs.
Support for aufs2.
Support for initramfs.
There are some extra options I put in the grub menu:
Start linux form RAM. This option is only possible if your ram is larger than data on the live media. This option can be useful if you are building a minimal command line rescue disc as it would enhance performance to start it from RAM.
Start in presistent mode. To learn about it more look here (https://help.ubuntu.com/community/LiveCDPersistence).
Start Linux in Text Mode. This will not start X. The user will be autologged into a virtual terminal (the kind of terminal you get when you press Alt+Ctrl+F1).
Hello capink, :popcorn:
thank you very much for the supply of this guide.
In order to have a better overview I tried to put together what should be needed for building a clean natty-live-cd,
I hope you like it, please correct me if I mentioned something wrong.
capink
August 23rd, 2011, 07:08 AM
Hello capink, :popcorn:
thank you very much for the supply of this guide.
In order to have a better overview I tried to put together what should be needed for building a clean natty-live-cd,
I hope you like it, please correct me if I mentioned something wrong.
Thank you for taking the time to put it together. This would make it easier for people wanting to make a clean CD. I posted a link to your post in the clean cd appendix. It will remain there as long as it in sync with the updates to the guide.
You joined the two guides fine, but while reading it I noticed a mistake I did in the original guide. In step C.10 replace $(uname -r) with $kversion. The old version would work only if the kernel is the same in both the chroot and the host.
grubu
August 23rd, 2011, 09:56 PM
Hello capink I hope it's replaced the right way.
The time sticking it together was a great pleasure as it seems that
I am a very good friend :) of working guides from beginning to end.
Capink, I have some problems with building a live-cd of my hd-installation,
tried it twice but all I am ending with is an iso which is not working either in
qemu or from a normal boot. Also the structure within the iso seems to be
not as it should.
Here is everything I did:
mkdir /media/ext4-external/work/
mkdir /media/ext4-external/cd/
export WORK=/media/ext4-external/work
export CD=/media/ext4-external/cd
export FORMAT=squashfs
export FS_DIR=casper
sudo apt-get update
sudo apt-get install grub2 xorriso squashfs-tools qemu
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/timezone --exclude=/etc/shadow* --exclude=/etc/gshadow* --exclude=/etc/X11/xorg.conf* --exclude=/etc/gdm/custom.conf --exclude=${WORK}/rootfs / ${WORK}/rootfs
sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs
sudo mount --bind /dev/ ${WORK}/rootfs/dev
sudo mount -t proc proc ${WORK}/rootfs/proc
sudo mount -t sysfs sysfs ${WORK}/rootfs/sys
sudo mount -t devpts devpts ${WORK}/rootfs/dev/pts
sudo chroot ${WORK}/rootfs /bin/bash
LANG=
apt-get update
apt-get install casper
apt-get install ubiquity ubiquity-frontend-gtk
sudo apt-get install gparted testdisk reiserfsprogs jfsutils ntfs-3g ntfsprogs dosfstools mtools lvm2
depmod -a $(uname -r)
update-initramfs -u -k $(uname -r)
for i in `cat /etc/passwd | awk -F":" '{print $1}'`; do uid=`cat /etc/passwd | grep "^${i}:" | awk -F":" '{print $3}'`; [ "$uid" -gt "998" -a "$uid" -ne "65534" ] && userdel --force ${i} 2>/dev/null; done
apt-get clean
find /var/log -regex '.*?[0-9].*?' -exec rm -v {} \;
find /var/log -type f | while read file; do cat /dev/null | tee $file; done
rm /etc/resolv.conf /etc/hostname
exit
export kversion=`cd ${WORK}/rootfs/boot && ls -1 vmlinuz-* | tail -1 | sed 's@vmlinuz-@@'`
sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-${kversion} ${CD}/boot/vmlinuz
sudo cp -vp ${WORK}/rootfs/boot/initrd.img-${kversion} ${CD}/boot/initrd.img
sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot
sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}/filesystem.manifest
sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}
REMOVE='ubiquity casper user-setup os-prober libdebian-installer4'
for i in $REMOVE ; do sudo sed -i "/${i}/d" ${CD}/${FS_DIR}/filesystem.manifest-desktop; done
sudo umount ${WORK}/rootfs/proc
sudo umount ${WORK}/rootfs/sys
sudo umount ${WORK}/rootfs/dev/pts
sudo umount ${WORK}/rootfs/dev
sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappend
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/casper/filesystem.size
find ${CD} -type f -print0 | xargs -0 md5sum | sed "s@${CD}@.@" | grep -v md5sum.txt |sudo tee ${CD}/md5sum.txt
sudo gedit ${CD}/boot/grub/grub.cfg
set default="0"
set timeout=10
menuentry "Ubuntu GUI" {
linux /boot/vmlinuz boot=casper quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu in safe mode" {
linux /boot/vmlinuz boot=casper xforcevesa quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu CLI" {
linux /boot/vmlinuz boot=casper textonly quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu GUI persistent mode" {
linux /boot/vmlinuz boot=casper persistent quiet splash
initrd /boot/initrd.img
}
menuentry "Ubuntu GUI from RAM" {
linux /boot/vmlinuz boot=casper toram quiet splash
initrd /boot/initrd.img
}
menuentry "Check Disk for Defects" {
linux /boot/vmlinuz boot=casper integrity-check quiet splash
initrd /boot/initrd.img
}
menuentry "Memory Test" {
linux16 /boot/memtest86+.bin
}
menuentry "Boot from the first hard disk" {
set root=(hd0)
chainloader +1
}
sudo grub-mkrescue -o ~/live-cd.iso ${CD}
sudo qemu -cdrom ~/live-cd.iso -boot d
This line gave me some trouble:
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/casper/filesystem.size
I am not sure if its syntax is wrong and this one would be right?:
echo -n $(sudo du / -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/casper/filesystem.size
Do you have an idea what I did wrong?
Thanks a lot for reading Capink.
capink
August 24th, 2011, 09:10 AM
Capink, I have some problems with building a live-cd of my hd-installation,
tried it twice but all I am ending with is an iso which is not working either in
qemu or from a normal boot.
In what way is not working? Is it giving you error message at startup? If so please tell what is the error message.
Also the structure within the iso seems to be
not as it should.
I will need to see the structure of the ISO. To do so do the following:
sudo apt-get install tree
and post the output of the following command:
sudo tree /media/ext4-external/cd/
This line gave me some trouble:
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/casper/filesystem.size
Again please post the exact error message this command is giving you. Anyway, even without this command the ISO should boot fine. the file created above is only necessary for the installer.
One last question, have you been able to successfully create a clean cd from scratch?
grubu
August 25th, 2011, 06:04 AM
Hello Capink,
hm, it seems that this structure is as it should be:
/media/ext4-external/cd/
├── boot
│ ├── grub
│ │ └── grub.cfg
│ ├── initrd.img
│ ├── memtest86+.bin
│ └── vmlinuz
├── casper
│ ├── filesystem.manifest
│ ├── filesystem.manifest-desktop
│ ├── filesystem.size
│ └── filesystem.squashfs
└── md5sum.txt
But when I look into the written iso I have something like three "grub" and three "casper" folders which looks by far different to any other livecd. Maybe it is just because the iso written in the right way.
I tried both guides a few times but can not get a working result. I have no clue on what I did wrong, but will try both again these days and then report the results I am getting.
GeoMX
September 5th, 2011, 06:27 PM
I'm reading your updated guide and trying to create a USB instead of a Live CD, but when trying to boot from it, I finish with a BusyBox shell and this message:
(initramfs) Unable to find a medium contining a live file system.
Unless I copy the ${CD}/casper directory to the USB, but it beats the purpose of using the .iso doesn't it?
-----------------------
Right now I'm trying to boot using the files contained in the ISO as described by prohp in 261 (http://ubuntuforums.org/showpost.php?p=10663680&postcount=261) (but using grub2 instead of grub legacy), but no success till now.
-----------------------
I've succesfully booted from an USB stick using the casper directory files (not the live-cd.iso), the steps I followed:
Mount USB stick (let's suppose it's mounted on /media/USB)
Copy ${CD}/casper directory to USB stick
Install GRUB to USB stick
sudo grub-install --no-floppy --force --root-directory=/media/USB /dev/sdX
Copy ${CD}/boot/vmlinuz,initrd.img,memtest86+.bin to /media/USB/boot/
Edit grub.cfg, you can use similar options to the ones used for the live CD.
capink
September 8th, 2011, 06:00 AM
I don't know what is happening in your case. But since you are dropped into a tty shell it means that grub was able to load both the kernel and the initrd just fine. The problem is that for some reason initrd might not be able to mount the ISO image. To debug this: when you are dropped into the tty shell please type the following command:
cat casper.log
also to know whether the iso is mounted type:
ls /cdrom
Post the output of the previous two commands.
Some people reported problems when using usb3. If that is your case, try using an old usb2 port and see if there is any difference.
Last thing, I am trying to reproduce your problem. I what to know the format of your flash stick (vfat or ext2 ....)
GeoMX
September 8th, 2011, 12:57 PM
Thanks for your reply, this is the output of the commands:
cat casper.log
Begin: Running /scripts/casper-premount ...
Done.
Done.
Unable to find a medium containing a live file system
ls /cdrom
(nothing)
I've been trying with a FAT32 stick, after your comments I tried formatting it as ext3 but got same result.
capink
September 11th, 2011, 01:48 PM
Sorry for the delay, I've been busy the past few days. I have not been able to identify the cause of your problem. It is working fine for me.
Please if any one tried creating bootable ISO using this guide share your experiences with us.
Last thing, try the usb stick with other machines to see if it will work. Maybe the problem is that casper initrd does not contain the drivers for your specific usb controller.
capink
September 12th, 2011, 09:08 AM
One more thing. To be sure this is not a bug in casper, you can try using ubuntu's official ISO on your usb stick and see if it works. If it does not you can file a bug report to ubuntu devs.
imetallica
October 4th, 2011, 05:56 PM
I've got a question about post 284: http://ubuntuforums.org/showpost.php?p=11176942&postcount=284
Is it possible to make some tweaks in the GNOME desktop look? Like, start with a different wallpaper for example.
Thanks in advance, and a nice guide. :-)
maramyfriend
October 13th, 2011, 11:38 AM
Please excuse my ignorance but I wanted to make sure this is going to do what I think it will.
I have Ubuntu 11.4 installed on my desktop, I have installed the apps I want, installed oracle, and have it up and running.
Will this process basically give me a DVD so if I got a new computer and put that DVD into it I would have an exact replica of my current desktop installed?
Thanks
inameiname
October 14th, 2011, 01:40 AM
Please excuse my ignorance but I wanted to make sure this is going to do what I think it will.
I have Ubuntu 11.4 installed on my desktop, I have installed the apps I want, installed oracle, and have it up and running.
Will this process basically give me a DVD so if I got a new computer and put that DVD into it I would have an exact replica of my current desktop installed?
Thanks
If it all works correctly, it will create a new live DVD for you, just like the original Ubuntu 11.04 disc, but that disc will include the apps that you have installed, those you may have removed, including oracle installed, and etc. So yes, it should create an exact replica of your current desktop.
Speaking of that, why not just use Remastersys? It is a very small package that does all of that automatically for you. Unfortunately, it is a project that is no longer being developed. Fortunately, though, a fork of it, called Relinux, is in beta at the moment, and will ideally be a full replacement for it.
Anyway, Remastersys does full computer 'backups' (includes home folder) or 'distros' (no home folder) very easily. For 11.04, or Natty and earlier Ubuntu versions, you can still use Remastersys. I'll be sure to attach the last version of it that works for Ubuntu for you. Relinux, however, doesn't do a full computer 'backup' just yet, but that will soon be available.
Here is relinux:
http://lkubuntu.wordpress.com/2011/10/10/relinux-a-way-to-create-a-bootable-iso-out-of-your-system/
rajesh.kalapura
October 20th, 2011, 09:24 AM
Thanks Capink for such a nice tutorial.I have just made an Ubuntu 11.10 Live-cum-Install DVD with your tutorial.It contains almost all of my favourite software packages and having 3 GB in size.
After partitioning and user naming process,when I click the last install option ,the installing box that runs Ubuntu demos decreased to a small sized box.This is the only problem that I had faced,while installing with this Live-dvd.Anyway it's only a minor issue for me and I think it may be a fault from my side also....Thanks agian capink......:p:p:p
See the booting screen of the DVD I have made from Capink's guide
beer-in-box
October 21st, 2011, 05:53 PM
Thank you for this tutorial which should be a wiki.
I tried it and worked good. There were some issues when I tried it on virtual machine, but it said that it was my fault with nVidia drivers and some configuration.
So, I am going to reformat my system, update it, customize it and make a (insttallable) live cd out of it before doing anything stupid this time :)
gluni
October 24th, 2011, 04:35 PM
Any chance to see an adaptation of this tutorial for other distributions?
Maybe sabayon?
thx anyway
Orion13622
October 29th, 2011, 03:24 AM
I'm a bit of an intermediate Linux user (slightly passed newbie) and I've followed the directions exactly like you have them, however I've noticed 3 things.
1. Upon creating the MD5 hash, I get a permission denied for vmlinuz, but the rest of the files are ok.
2. If I switch over to verbose mode (alt-F2) during boot, I see several Permission Denied messages during startup.
3. Once the live DVD has started, I'm immediately taken to my login screen. Neither my user name, nor password work when trying to log in. I even went as far as making a user named ubuntu with a security of 999. Still no joy. Any suggestions would be greatly appreciated, as at this point, I'd love to have a Live DVD of my current system (11.04) that is installable, however if I can't get past the login screen, seems a bit of a moot point.
Just a shot in the dark, but I'm guessing that the MD5 Permission Denied error has something to do with this. Many thanks in advance.
Orion
carloseros
November 1st, 2011, 09:22 AM
its possible to do this on a debian installation :confused:, how to replace casper package?, because its not finding
note: sorry for my english im not speak very well
carloseros
November 1st, 2011, 01:22 PM
i got this little error! :confused:
sudo grub-mkrescue -o ~/live-cd.iso ${CD}
Unrecognized option `-o'
Usage: /usr/bin/grub-mkrescue [OPTION] SOURCE...
Make GRUB rescue image.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--output=FILE save output in FILE [required]
/usr/bin/grub-mkrescue generates a bootable rescue image with specified source files or directories.
Report bugs to <bug-grub@gnu.org>.
carloseros
November 1st, 2011, 02:08 PM
SOLUTION
$ sudo grub-mkrescue --output=live-cd.iso ${CD}
and it WORKED!
thanx!!!!! :)
this is for Ubuntu 10.10
User 04
November 1st, 2011, 11:22 PM
I read that it is possible to allocate new user name and password on re installation.
My question is, and hope not duplicating, if an application like MythTV is installed, will this still work properly.
This situation causes major problems with a Remastersys re install.
User 04
November 5th, 2011, 05:58 AM
Thanks carloseros for your command fix and thanks to capink for the guide. To answer my own question, a new computer name and so on can be successfully allocated on installation without adverse effect on MythTV.
undead2
November 9th, 2011, 09:20 AM
i want to create a custom distro. i want to change some default that they could be seen on my live disk:
1) change default icon pack to faenza-ambiance
2) change default start up apps to dockey & synapse & weather & blueman
3) change default shell(GUI) to gnome3.2
4) change default theme to adwaita
5) change default cursor to adwaita
any ideas?
undead2
November 9th, 2011, 10:55 AM
any ideas????
upppp...
undead2
November 9th, 2011, 10:56 AM
any ideas????
upppp...
Darin722
December 6th, 2011, 02:26 PM
I've run into a situation where it would be useful to create a live cd with non-system users intact.
I tried to modify the procedure above to do so by dropping the routine that removes users and including rather than excluding shadow and gshadow, but grub-mkisofs fails with a "disk image not readable, so such file" error.
Any suggestions as to how to resolve this issue?
capink
December 7th, 2011, 05:19 AM
but grub-mkisofs
The Guide uses grub-mkresuce
Any suggestions as to how to resolve this issue?
There are two ways to this:
1. The first way is to add the following parameter to your boot options in grub.cfg:
username=whatever_username_you_want
2. The second way edit the file ${WORK}/rootfs/etc/casper.conf change the following entry:
export USERNAME="whatever_username_you_want"
After doing this, be sure to run the command update-initramfs within the chroot enviroment (Step C.4). And that the updated initrd is copied later to ${CD}/casper/initrd.img in step D.1
Note that either way you go, you will still have to preserve the shadow and gshadow ..... etc as you described in your post. To do it you replace the command in step B with the following one:
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/timezone --exclude=/etc/X11/xorg.conf* \
--exclude=/etc/gdm/custom.conf --exclude=/etc/lightdm/lightdm.conf \
--exclude=${WORK}/rootfs / ${WORK}/rootfs
You will also have to skip step C.5
I have not tried any of this. You will have to try it yourself and see if it works.
Darin722
December 14th, 2011, 04:13 PM
Thanks for the reply Capink.
when you say add username=whateverUsername to bootoptions, do you mean like so...?
menuentry "Ubuntu GUI" {
linux /boot/vmlinuz boot=casper quiet splash username=dbAdmin
initrd /boot/initrd.img
}
Still getting the error..
...
> sudo grub-mkrescue --output=~/live-cd.iso ${CD}
Enabling BIOS support ...
Using GCRY_SHA.000;1 for /tmp/grub-mkrescue.bQShWUWJzO/boot/grub/i386-pc/gcry_sha1.mod (gcry_sha256.mod)
Using MULTIBOO.000;1 for /tmp/grub-mkrescue.bQShWUWJzO/boot/grub/i386-pc/multiboot2.mod (multiboot.mod)
Using GCRY_SHA.001;1 for /tmp/grub-mkrescue.bQShWUWJzO/boot/grub/i386-pc/gcry_sha256.mod (gcry_sha512.mod)
Using PASSWORD.000;1 for /tmp/grub-mkrescue.bQShWUWJzO/boot/grub/i386-pc/password.mod (password_pbkdf2.mod)
Using SEARCH_F.000;1 for /tmp/grub-mkrescue.bQShWUWJzO/boot/grub/i386-pc/search_fs_file.mod (search_fs_uuid.mod)
grub-mkisofs: Unable to open disc image file
: No such file or directory
I note that the output after "Enabling BIOS support" does not occur when I run the original version of the script (prior to editing to keep non-system users)
capink
December 14th, 2011, 05:44 PM
Thanks for the reply Capink.
when you say add username=whateverUsername to bootoptions, do you mean like so...?
Yes
Still getting the error..
...
> sudo grub-mkrescue --output=~/live-cd.iso ${CD}
I am not able to troubleshoot that one. Try replacing it with:
sudo grub-mkrescue -o ~/live-cd.iso ${CD}
And see if it makes any difference.
kebabbaro
December 14th, 2011, 06:11 PM
Yes
I am not able to troubleshoot that one. Try replacing it with:
sudo grub-mkrescue -o ~/live-cd.iso ${CD}And see if it makes any difference.
I'm getting the same error, whereas entering your code triggers this other error:
Unrecognized option `-o'
Usage: /usr/bin/grub-mkrescue [OPTION] SOURCE...
Make GRUB rescue image.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--output=FILE save output in FILE [required]
Any help?
Or do you know any other way to build a liveISO from your HD installation?
capink
December 14th, 2011, 06:21 PM
http://ubuntuforums.org/showpost.php?p=11532322&postcount=167
Darin722
December 15th, 2011, 01:33 AM
Yes
I am not able to troubleshoot that one. Try replacing it with:
sudo grub-mkrescue -o ~/live-cd.iso ${CD}
And see if it makes any difference.
I just ran grub-mkrescue directly from the command line instead of from the script and it worked fine!
grub-mkrescue --output=~/live-cd.iso ~/cd
The live CD was generated and all users are intact and usable, so the greater part of the project at least is a success. I'm still trying to debug why the script is throwing the error. --go figure.
I checked the script var ${CD} and it appears to be fine. It's set to /home/dbadmin/cd which is the directory that contains /boot /casper, and /md5sum.txt
It also appears that the -o switch is no longer supported by grub-mkrescue, hence the use of --output=
anyway. Thanks for all your help! I suspect the fault is some little detail. If I find a solution I'll post it.
kebabbaro
December 16th, 2011, 06:03 AM
http://ubuntuforums.org/showpost.php?p=11532322&postcount=167
Thank you that fixed my problem. I will try again your method ASAP, possibly building the ISO file with a burning tool like Brasero or something, and creating the bootable USB with the Ubuntu Disk Creator. Will post the outcome here.
kebabbaro
December 19th, 2011, 01:51 PM
Ok I made it. Here's the solution: If grub-mkrescue command outputs an error, it is sufficient to burn the ISO using Brasero, and build the USB PenDrive using Unetbootin. The standard Ubuntu USB Disk Creator doesn't work though.
To burn the ISO just drag and drop all the files inside the cd directory into the Brasero window. That is after you added permission to read to the filesystem.squashfs file inside the casper directory, for if you don't do that Brasero cannot burn that required file.
FYI the procedure was tested on a Linux Mint 9 ( based on Ubuntu 10.04 ) machine. However, the grub-mkrescue command outputs that same error on both Linux Mint 9 32 bit and Ubuntu 10.04 64 bit.
The only substantial change I made to these installations is changing the default directories location, I mean the location of Documents, Downloads, etc. I changed those locations by editing the ~/config/user-dirs.dirs file, putting those directories in a separate "storage" partition, and changing the /etc/fstab file of course in order to automatically mount that partition.
This change i made on both my Linux Mint and Ubuntu machines. I dunno if this is somewhat related to the grub-mkrescue mulfunctioning.
Thank you for your attention.
kebabbaro
December 19th, 2011, 02:26 PM
I dunno if this is somewhat related to the grub-mkrescue mulfunctioning.
No of course NOT!
I had the solution under my nose but I needed to write a post to realize it #-o
Obviously the reason why grub-mkrescue could not find the source file is the same reason why brasero could not read all the file: because the fylesystem.squashfs file, which is the major file containing the system data ( on my installation it is 2.5 GB big ), had no permission to be read, even from root.
So in the end it is sufficient to execute the following command:
sudo chmod +r ~/cd/casper/filesystem.squashfsto fix the problem.
That I just tested ):P
hsretry
December 23rd, 2011, 11:33 AM
Wow .. I was looking for something like this .. I am a newbie of sorts so I'd appreciate any inputs.
I am looking to make a live CD of my current setup of 10.04 so I can use it to re-install it in the likely case that I break my system while tinkering it. I think this is what is being intended by the instructions on the first page. Please correct me if I'm wrong.
If this works out will I have a live CD of 10.04 plus the extra packages that I have installed on my laptop after a clean install of the OS ? Again I'm a newbie who's broken his system on more than once and I want to have a backup that I can install without worrying about having internet to install a package ..
I'll be trying this anyways just for the experience !
Cheers,
kebabbaro
January 14th, 2012, 08:35 AM
I have one little problem: after installing Ubuntu with the live media created using this procedure, I am not able to successfully login. System prompts me to insert password at login screen but any password won't work, even the password I just chose during the installation process, why is that? :confused:
msmihai
January 18th, 2012, 09:03 PM
Hi everybody!
I used this method and successfuly obtained a Live CD image that had all the packets that I had installed on my installation.
However, i would like the following as well:
- all that is related to gnome desktop to be saved ( so that the live distribution would have the same desktop, panel elements, etc.)
- firefox plugins and bookmarks saved as well
I manually added .config, .bashrc and .mozilla ( all folders in /home/mihai/, where mihai is my username) to the rootfs/etc/skel but that doesn not do the trick.
Any ideas?
User 04
January 28th, 2012, 05:09 PM
I have successfully created .iso's for Ubuntu distributions from Ubuntu 9.10 up to Ubuntu 12.04 Beta 1. However, with the latest updates can successfully create .iso, but when trying to install arrive at a log in screen with only one option, that is Guest Session, not able to enter ubuntu, no password.
Have also found that with the latest updates can no longer log in to root using previous processes. Only able to log in with a password as "Computer User", or as Guest Session, no password.
Can provide a Clonezilla copy via my website if required.
Darin722
February 4th, 2012, 07:57 AM
Hi everybody!
I used this method and successfuly obtained a Live CD image that had all the packets that I had installed on my installation.
However, i would like the following as well:
- all that is related to gnome desktop to be saved ( so that the live distribution would have the same desktop, panel elements, etc.)
- firefox plugins and bookmarks saved as well
I manually added .config, .bashrc and .mozilla ( all folders in /home/mihai/, where mihai is my username) to the rootfs/etc/skel but that doesn not do the trick.
Any ideas?
Can you mention what is and what is not being preserved?
Darin722
February 4th, 2012, 08:05 AM
I have one little problem: after installing Ubuntu with the live media created using this procedure, I am not able to successfully login. System prompts me to insert password at login screen but any password won't work, even the password I just chose during the installation process, why is that? :confused:
That sounds suspiciously like the problem I was originally having. The problem turned out to be that there was a user that should have been deleted from the shadow and password files that wasn't being deleted. Check to see that all users with user id's 998 and above are removed as per Capink's original tutorial http://ubuntuforums.org/showthread.php?t=688872&highlight=users+%26gt%3B+999
acantonyclark1
March 13th, 2012, 04:28 AM
If you want to make Live CD/DVD then it is better to download Linux Install Disk. You can use this disk to boot your computer and repair computer from crashes. It contains both the kernel and the root file system.You can use this to boot your computer without hard drive. You can free download Linux Install Disk (http://www.linuxbootdisks.net) and can use free of cost.
Darin722
March 21st, 2012, 05:54 PM
If you want to make Live CD/DVD then it is better to download Linux Install Disk. You can use this disk to boot your computer and repair computer from crashes. It contains both the kernel and the root file system.You can use this to boot your computer without hard drive. You can free download Linux Install Disk (http://www.linuxbootdisks.net) and can use free of cost.
Ah, but the point here is the ability to make a CUSTOM live cd, containing the programs and potentially data that we choose.
ezacon
April 15th, 2012, 03:20 PM
I have successfuly built mi live CD from an installed Ubuntu Server 11.04.
I use it to automaticaly remove a partition in the computer where the live cd is booted. I have writed mi script and everithing is working fine.... except:
At boot, the live cd try to get an IP with dhcp, and produces a delay of 2 minutes in boot process. In my squash, /etc/network/interfaces has only lo configred, but in live cd, this file has entries for several interfaces. This network config file is not present in squash nor in inird.
Where did this file come from?
How can i avoid dhcp delay in boot. i dont need networking.
Thanks
capink
April 17th, 2012, 07:07 AM
Append the following to the boot options in grub.cfg:
ip=frommedia
User 04
May 12th, 2012, 06:48 PM
I have successfully created .iso's for Ubuntu distributions from Ubuntu 9.10 up to Ubuntu 12.04 Beta 1. However, with the latest updates can successfully create .iso, but when trying to install arrive at a log in screen with only one option, that is Guest Session, not able to enter ubuntu, no password.
Have also found that with the latest updates can no longer log in to root using previous processes. Only able to log in with a password as "Computer User", or as Guest Session, no password.
Finally got time to look at this issue.
Access terminal,
sudo -i
gedit /etc/lightdm/lightdm.conf
add line,
greeter-show-manual-login=true
and this line if not already there,
user-session=ubuntu
mine now looks like this,
[SeatDefaults]
autologin-guest=false
autologin-user=user
autologin-user-timeout=0
autologin-session=lightdm-autologin
user-session=ubuntu
greeter-session=unity-greeter
greeter-show-manual-login=true
Reboot and Bob's UR Uncle, although theses days he is prob UR trannie Aunt.
TheShadwofChaos
May 20th, 2012, 01:42 PM
I just keep getting " invalid option -- '/'" Sorry about the stupid question but what am I missing?
goaliedude3919
May 23rd, 2012, 10:56 AM
This is an excellent topic. I was hoping that there was a way to do this. I have Ubuntu on my Laptop and plan on putting it on the next Desktop that I get. I was dreading having to install all of my software again, so this will be a life saver.
roshgorg
May 26th, 2012, 11:07 PM
I have a few questions. After completing this step, will the Ubuntu themes, splash screens, logos etc be installed ?
Will it be possible to :-
add Ubuntu desktop GUI with Unity.
add essential software and applications, including network.
add other software
And above all, I need to install my own kernel.
I need to change the background images, logos and themes.
Is it possible to change the boot animation ?
I have read somewhere that, it is possible to change the prompt ubuntu@ubuntu to something else. How to change this ?
How is it possible? Will Ubuntu Customization Kit work ?
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.