Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

* * * * * 1 votes

Add A Compressed Frugal Rambooting Counterpart To Your Debian Installation


  • Please log in to reply
No replies to this topic

#1 Guest_hollowface_*

Guest_hollowface_*

  • Guests
  • OFFLINE
  •  

Posted 08 December 2016 - 05:42 PM

Add A Compressed Frugal Rambooting Counterpart To Your Debian Installation

pftfgn.JPG


djaphw.JPG


bweexg.JPG



Caution! Please read for more information.
If you seek elaboration on something covered in this guide, in most cases, it will be better to start a new thread, than to ask here.



Guide Overview

The purpose of this guide is to walk you through adding a compressed clone of your Debian installation, which is loaded into memory at boot, and then run frugally. This can offer security, and speed advantages. This tutorial uses the live-boot method to achieve this.

Tools Needed
  • Debian 8.6.0 LXDE AMD64 installation under a GUID partition table
  • Lubuntu 16.04.1 AMD64 live-DVD
  • Internet connection
  • Lots of RAM. You will need enough RAM to house the Debian image, enough RAM to give free space for the in-RAM root partition, and still have enough RAM left over to meet Debian's operating RAM requirements.
Instructions


Caution! Please read for more information.

This guide provides specific instructions intended for a specific system setup. If your setup differs (it likely does), and you aren't sure how/if your deviations will affect your ability to complete these instructions, open a new thread detailing your system and asking how to proceed. In this guide a UEFI computer, running Debian 8.6.0 LXDE AMD64, with a single hardrive formatted with a GPT, was used. The Debian installation only has a root partition, and a swap partition.




Warning! Please read this first.

This guide involves modifying your Grub configuration. Failed attempts to update Grub could leave your setup unable to boot ANY operating system reliant on Grub. It is recommended that you take appropriate measures to prepare for such a disaster scenario BEFORE attempting this tutorial (eg: backing up your drive). If you need help preparing for disasters, start a new thread to discuss your options, or search the forums for past threads.



Initial Setup
  • Login to the root account.
  • Run:
    aptitude update
    .
  • Run:
    aptitude install live-boot live-build live-tools initramfs-tools squashfs-tools
  • Run:
    aptitude clean
  • Boot your Lubuntu live-DVD, and choose "Try Lubuntu without installing".
  • Run:
    sudo apt-get update
  • Run:
    sudo apt-get install squashfs-tools
  • Run:
    sudo mkdir "/media/mnt1"
  • Substituting "/dev/sdL#" for the partition of the Debian rootfs (eg: "sda2"), run:
    sudo mount /dev/sdL# /media/mnt1
    If you aren't sure which partition the Debian rootfs is on, you can use "sudo parted -l" to list your drives and partitions.
  • Run:
    sudo nano "/media/mnt1/etc/fstab"
  • In Nano type a single "#" at the front of each line (regardless of whether it already has any), press "control" + "x", press "enter", type "y", and press "enter".
  • Run:
    sudo mkdir "/media/mnt1/live"
  • Run:
    sudo mksquashfs "/media/mnt1" "/media/mnt1/live/filesystem.squashfs" -e "/media/mnt1/live"
  • Run:
    sudo nano "/media/mnt1/etc/fstab"
  • In Nano remove the first "#" from the beginning of each line, press "control" + "x", press "enter", type "y", and press "enter".
  • Run:
    sudo umount "/media/mnt1"
  • Reboot into Debian, and login to the root account.
  • Run:
    nano "/etc/grub.d/40_custom"
  • In Nano, at the bottom, substituting "vmlinuz-3.16.0-4-amd64", "initrd.img-3.16.0-4-amd64", and "15284e16-8060-47a3-9bae-bd817103ec14" for correct values, type:
    menuentry "Debian Compressed Frugal Rambooting" {
    search --no-floppy --fs-uuid --set=root 15284e16-8060-47a3-9bae-bd817103ec14
    	insmod gzio
    	insmod part_gpt
    	insmod ext2
    	linux	/boot/vmlinuz-3.16.0-4-amd64 boot=live toram live-media-path=/live root=UUID=15284e16-8060-47a3-9bae-bd817103ec14 ro quiet
    	initrd	/boot/initrd.img-3.16.0-4-amd64
    }
    
    Press "control" + "x", press "enter", type "y", and press "enter". If you don't know what to substitute "vmlinuz-3.16.0-4-amd64", or "initrd.img-3.16.0-4-amd64" for, type "cd "/boot" && echo * && cd -", to see which
    kernel releases you have available. If you don't know what to substitute "15284e16-8060-47a3-9bae-bd817103ec14" for, type "blkid" and find the filesystem
    UUID for your Debian root partition (eg: "UUID="15284e16-8060-47a3-9bae-bd817103ec14"").
  • Run:
    update-grub
Updating Setup
Down the road you may wish to make changes to the frugal root system. There is no need to repeat the entire process to accomplish this.
  • After making the changes to your Debian installation, boot your frugal rambooting Debian, and login to the root account.
  • Run:
    mkdir "/media/mnt1"
  • Substituting "/dev/sdL#" for the partition of the Debian rootfs (eg: "sda2"), run:
    mount /dev/sdL# /media/mnt1
    If you aren't sure which partition the Debian rootfs is on, you can use "blkid" to list your drives and partitions.
  • Run:
    nano "/media/mnt1/etc/fstab"
  • In Nano type a single "#" at the front of each line (regardless of whether it already has any), press "control" + "x", press "enter", type "y", and press "enter".
  • Run:
    rm /media/mnt1/live/filesystem.squashfs
  • Run:
    mksquashfs "/media/mnt1" "/media/mnt1/live/filesystem.squashfs" -e "/media/mnt1/live"
  • Run:
    nano "/media/mnt1/etc/fstab"
  • In Nano remove the first "#" from the beginning of each line, press "control" + "x", press "enter", type "y", and press "enter".
  • Run:
    umount "/media/mnt1"
  • Run:
    rmdir "/media/mnt1"
  • Reboot into Debian, and login to the root account.
  • (If not sure, do this) If your kernel release has changed, run:
    nano "/etc/grub.d/40_custom"
  • (If not sure, do this) If your kernel release has changed, in Nano, substitute "vmlinuz-3.16.0-4-amd64", and "initrd.img-3.16.0-4-amd64" for correct values.
    If you don't know what to substitute "vmlinuz-3.16.0-4-amd64", or "initrd.img-3.16.0-4-amd64" for, type "cd "/boot" && echo * && cd -", to see which
    kernel releases you have available. Press "control" + "x", press "enter", type "y", and press "enter".
  • (If not sure, do this) If your kernel release has changed, run:
    update-grub
Notes
  • This guide assumes you've already setup your Debian installation.
  • This guide assumes you know how to boot a Lubuntu live-DVD.
  • You can verify that it is running from RAM by running:
    df -h
    This will list all mounted partitions. Check to see if your Debian root partition is mounted. It shouldn't be, unless you have manually mounted it. If it is mounted, then the system is booted frugally, but not from RAM. This will happen if you don't have enough RAM.
Sources

BC AdBot (Login to Remove)

 


m



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users