HOWTO: Boot LMDE squashfs directly from HDD

Archived topics about LMDE 1 and LMDE 2
Locked
ugh

HOWTO: Boot LMDE squashfs directly from HDD

Post by ugh »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 5 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
darethehair
Level 4
Level 4
Posts: 239
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: HOWTO: Boot LMDE squashfs directly from HDD

Post by darethehair »

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.p ... 43&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.
ugh

Re: HOWTO: Boot LMDE squashfs directly from HDD

Post by ugh »

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.
jeffreyC

Re: HOWTO: Boot LMDE squashfs directly from HDD

Post by jeffreyC »

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

Very good to know, thank you.
huh

Re: HOWTO: Boot LMDE squashfs directly from HDD

Post by huh »

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.
Locked

Return to “LMDE Archive”