Dropbox 8 – Dropbox Server (Safe Boot)

We’ll be modifying the initial RAM file system so making a backup is a “good idea”.

Run the following and look for an output similar to what’s shown below.

ls -al /boot | grep init
-rw-r--r-- 1 root root 25485034 Sep 12 18:50 initrd.img-4.6.0-kali1-amd64

Copy the identified file to “filename-safe”, similar to this.

cp initrd.img-4.6.0-kali1-amd64 initrd.img-4.6.0-kali1-amd64-safe

Now we’re going to create a grub entry that will allow us to boot into our backup. First print your grub config file.

cat /boot/grub/grub.cfg

Copy the first ‘menuentry’ item. It should look something like the following.

menuentry 'Kali GNU/Linux' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-02246475-f164-41fe-9ccb-ec1f5e795f68' {
 load_video
 insmod gzio
 if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
 insmod part_msdos
 insmod ext2
 set root='hd0,msdos1'
 if [ x$feature_platform_search_hint = xy ]; then
 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 dc38f655-fee5-41e2-b476-d7144ca9cbc3
 else
 search --no-floppy --fs-uuid --set=root dc38f655-fee5-41e2-b476-d7144ca9cbc3
 fi
 echo 'Loading Linux 4.6.0-kali1-amd64 ...'
 linux /vmlinuz-4.6.0-kali1-amd64 root=/dev/mapper/dbox--01--vg-root ro initrd=/install/gtk/initrd.gz quiet
 echo 'Loading initial ramdisk ...'
 initrd /initrd.img-4.6.0-kali1-amd64
}

Paste that into the file below and modify the highlighted sections with -safe (SAFE)

vi/vim/nano /etc/grub.d/40_custom

#!/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 'Kali GNU/Linux SAFE' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-02246475-f164-41fe-9ccb-ec1f5e795f68' {
 load_video
 insmod gzio
 if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
 insmod part_msdos
 insmod ext2
 set root='hd0,msdos1'
 if [ x$feature_platform_search_hint = xy ]; then
 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 dc38f655-fee5-41e2-b476-d7144ca9cbc3
 else
 search --no-floppy --fs-uuid --set=root dc38f655-fee5-41e2-b476-d7144ca9cbc3
 fi
 echo 'Loading Linux 4.6.0-kali1-amd64-safe ...'
 linux /vmlinuz-4.6.0-kali1-amd64 root=/dev/mapper/dbox--01--vg-root ro initrd=/install/gtk/initrd.gz quiet
 echo 'Loading initial ramdisk ...'
 initrd /initrd.img-4.6.0-kali1-amd64-safe
}

Update your grub.

update-grub

Reboot and verify that you can boot into the SAFE environment. If everything works then reboot again and select the normal boot environment.

NOTE: If you just get a blank screen you may need to go back in to your firmware and change it to boot off of the SSD again.

Leave a Reply

Your email address will not be published. Required fields are marked *