HOWTO: Boot LMDE squashfs directly from HDD

Write tutorials here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this

HOWTO: Boot LMDE squashfs directly from HDD

Postby ugh on Sat Sep 25, 2010 9:51 pm

This is a simple way to boot the compressed squashfs contained within the LMDE.iso directly from a hard drive.
This equates to the same thing as booting from a DVD but without the DVD.

UPDATE: 08.24.2011 - edited to use existing 40_custom file instead of creating a new file for GRUB.
- Tested with linuxmint-201108-gnome-64bit-rc.iso

Why would you want to do this?
Makes for a handy backup.
Nearly an unbreakable OS - you just need GRUB to boot it.
Perhaps you're out of blank media.
It's faster than burning a blank.

First we need to extract some files from the .iso image. Get root

Code: Select all
# mkdir loopmount
# mount -o loop /path/to/linuxmint-201108-gnome-64bit-rc.iso loopmount
# ls loopmount
total 5
dr-xr-xr-x 2 root root 2048 Apr 29 03:32 isolinux
dr-xr-xr-x 2 root root 2048 Sep  5 10:10 casper
-r--r--r-- 1 root root  526 Sep  5 10:12 md5sum.txt


Now that the .iso is loop mounted we can copy files from the .iso onto the hard drive.
The aim is to replicate the DVD filesystem structure on the hard drive.

Code: Select all
# mkdir /casper
# cp loopmount/casper/* /casper


You can make sure it's all there:

Code: Select all
# ls /casper
total 1139288
-r-xr-xr-x 1 root root    2690384 Aug  7 13:51 vmlinuz
-r--r--r-- 1 root root    9406326 Aug  7 13:51 initrd.lz
-r--r--r-- 1 root root         11 Aug  7 13:51 filesystem.size
-r--r--r-- 1 root root      36057 Aug  7 13:51 filesystem.manifest
-r--r--r-- 1 root root 1154428928 Aug  7 14:02 filesystem.squashfs
-r--r--r-- 1 root root      36025 Aug  7 14:02 filesystem.manifest-desktop


Now to notify GRUB that it exists and make it bootable.

For grub-pc
Add an entry to /etc/grub.d/40_custom.
If you're using the first partition of the first hard drive, you can simply copy paste the below code block as root and press enter:

Code: Select all
cd /etc/grub.d/
cat >> 40_custom << EOF
menuentry "Linux Mint Debian squashfs" {
set root=(hd0,1)
linux  /casper/vmlinuz boot=live live-media-path=/casper quiet splash gfxpayload=1024x768
initrd /casper/initrd.lz
}
EOF
update-grub2



For grub-legacy
Add an entry to /boot/grub/menu.lst

Code: Select all
title      LMDE
root       (hd0,0)
kernel       /casper/vmlinuz boot=live live-media-path=/casper quiet splash vga=791
initrd      /casper/initrd.lz


*Note*
You can still access the partition that the image was booted from mounted @ /live/image
If you intend to use the squashfs as a repair tool you might want a separate partition for the squashfs itself.
This way you can still chroot into any other partition.
Last edited by ugh on Wed Aug 24, 2011 4:58 pm, edited 4 times in total.
OS: Linux Mint / Debian Sid
Kernel: 3.2.0-2-amd64
Desktop: Cinnamon
ugh
Level 1
Level 1
 
Posts: 31
Joined: Wed Sep 22, 2010 4:20 pm

Linux Mint is funded by ads and donations.
 

Re: HOWTO: Boot LMDE squashfs directly from HDD

Postby darethehair on Fri Oct 29, 2010 11:11 am

Thanks for this post -- but can your knowledge of these grub2 matters help with the situation described in this related post?

http://forums.linuxmint.com/viewtopic.php?uid=16360&f=141&t=55543&start=0

There are some of us that want to use the 'direct ISO boot' ability of grub2 to boot Linux Mint Debian from a USB stick, *without* extracting pieces of it in order to work.
There is nothing more dangerous than a bored cat.
User avatar
darethehair
Level 3
Level 3
 
Posts: 177
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada

Re: HOWTO: Boot LMDE squashfs directly from HDD

Postby ugh on Wed Aug 24, 2011 5:06 pm

Cleaned up and updated original howto for linuxmint-201108-gnome-64bit-rc.iso.
It's preferable (and easier) to use the existing /etc/grub.d/40_custom instead of creating a new one.
OS: Linux Mint / Debian Sid
Kernel: 3.2.0-2-amd64
Desktop: Cinnamon
ugh
Level 1
Level 1
 
Posts: 31
Joined: Wed Sep 22, 2010 4:20 pm

Re: HOWTO: Boot LMDE squashfs directly from HDD

Postby jeffreyC on Wed Aug 24, 2011 8:22 pm

This should also allow using a DVD size ISO in a computer with only a CD drive.

Very good to know, thank you.
Get Dropbox and an extra 250 mb http://db.tt/wAizqw0
jeffreyC
Level 4
Level 4
 
Posts: 318
Joined: Mon Jun 07, 2010 9:34 pm

Re: HOWTO: Boot LMDE squashfs directly from HDD

Postby huh on Thu Sep 01, 2011 10:46 pm

Hi ugh,

I want to install LMDE from my hard drive. I used your guide except for two changes:

1) I copied /caspar to /home/caspar which is my sda8 since / (sda7) is going to be formatted
2) I replaced (hd0,1) with (hd0,8)

The live dvd seems to boot properly but something is wrong. gksudo is unable to load the installer (nothing happens) and when I start it manually it stops when it tries to check my partitions. Furthermore sudo asks me for a password and the terminal tells me that there is neither shutdown nor reboot in my sbin.

I usually install isos using grub2's loopback option and have to unmount /loopback after booting. So I checked mount and found /dev/sda8 mounted on /live/image.

Thanks in advance!

Edit: I tried the Debian Live CD which showed me a login screen. Seems to be the same issue.
huh
Level 1
Level 1
 
Posts: 2
Joined: Thu Sep 01, 2011 10:25 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest