Darik’s Boot And Nuke , After dban unable to boot linux or any os


i have used Darik’s Boot And Nuke , to delete my 2 laptop’s hd , so … after that i have installed without problems linux and everything was ok.

but they did not boot…. but i have fixed thank to irc guys again

so why ? i dunno anyway i have followed these tutorial to fix mbr :

1 i have done this but i don’t believe that it’s necessary : (note i had only linux so i have installed in the first partition that is called sda in my system you need to change the code if yours it’s different , sudo fdisk -l will help you to understand where is windows if you have , or the first partition anyway.)

sudo fdisk -l ; sudo ms-sys -w /dev/sdxxx

then

i have just restored grub2

note that fdisk should tell you where is installed kubuntu , if you don’t know just try to see where is installed with a live cd .

so i will use sda1 cuz my system was installed on sda… change the code if you need it

sudo fdisk -l ; sudo mount /dev/sda1 /mnt ; sudo mount --bind /dev /mnt/dev; sudo mount --bind /proc /mnt/proc; sudo mount --bind /sys /mnt/sys ; sudo chroot /mnt ; grub-install /dev/sda ;  update-grub2

kgrubeditor==> grub2 boootloader editor kubuntu kde



Download source here

http://kde-apps.org/content/show.php/GRUB2+Bootloader+Editor?content=139643

Build-Depends:

cmake kdelibs5-dev libmagickcore-dev libmagick++-dev libhd-dev libqapt-dev

now extract somewhere for example in /tmp

edit the CMakeList.txt

kate /tmp/kcm-grub2-0.4.5/CMakeList.txt

now replace with this stuff

project(kcm-grub2)
set(KCM_GRUB2_VERSION_MAJOR "0")
set(KCM_GRUB2_VERSION_MINOR "4")
set(KCM_GRUB2_VERSION_PATCH "5")
set(KCM_GRUB2_VERSION "${KCM_GRUB2_VERSION_MAJOR}.${KCM_GRUB2_VERSION_MINOR}.${KCM_GRUB2_VERSION_PATCH}")

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})

find_package(Qt4 4.6.0 REQUIRED)
find_package(KDE4 4.4.0 REQUIRED)
include(KDE4Defaults)

macro_optional_find_package(ImageMagick COMPONENTS Magick++ MagickCore)
macro_log_feature(ImageMagick_FOUND "ImageMagick" "Create splash images compatible with GRUB2" "http://www.imagemagick.org/" FALSE "" "")
macro_bool_to_01(ImageMagick_FOUND HAVE_IMAGEMAGICK)

macro_optional_find_package(HD)
macro_log_feature(HD_FOUND "hwinfo" "Retrieve list of resolutions valid in GRUB2" "http://www.opensuse.org/" FALSE "" "")
macro_bool_to_01(HD_FOUND HAVE_HD)

macro_optional_find_package(QApt)
macro_log_feature(QAPT_FOUND "LibQApt" "Remove unneeded old entries (qapt backend)" "https://projects.kde.org/projects/extragear/sysadmin/libqapt/" FALSE "" "")
macro_bool_to_01(QAPT_FOUND HAVE_QAPT)

macro_optional_find_package(QPackageKit)
macro_log_feature(QPACKAGEKIT_FOUND "QPackageKit" "Remove unneeded old entries (qpackagekit backend)" "http://www.packagekit.org/" FALSE "" "")
macro_bool_to_01(QPACKAGEKIT_FOUND HAVE_QPACKAGEKIT)

macro_display_feature_log()
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)

add_subdirectory(cfg)
add_subdirectory(other)
add_subdirectory(src)


set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KCM_GRUB2_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*$;kdev4$;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_SOURCE_GENERATOR "TBZ2")

set(CPACK_PACKAGE_NAME "kcm-grub2")
set(CPACK_PACKAGE_DESCRIPTION "GRUB2 Bootloader Editor")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A KCModule for configuring the GRUB2 bootloader")
SET(CPACK_PACKAGE_VERSION_MAJOR ${KCM_GRUB2_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${KCM_GRUB2_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${KCM_GRUB2_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_PACKAGE_CONTACT "Konstantinos Smanis <konstantinos.smanis@gmail.com>")
set(CPACK_GENERATOR "DEB;RPM")

set(CPACK_DEBIAN_PACKAGE_DEPENDS "kdebase-runtime (>= 4:4.4.0), grub-common, libmagickcore3, libmagick++3, libhd16, libqapt-runtime")
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "imagemagick")
set(CPACK_DEBIAN_PACKAGE_SECTION "KDE")
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})

set(CPACK_RPM_PACKAGE_REQUIRES "kdebase-runtime >= 4.4.0, grub2, ImageMagick")
set(CPACK_RPM_PACKAGE_GROUP "System/GUI/KDE")
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})

include(InstallRequiredSystemLibraries)
include(CPack)

mkdir build ; cd build ; cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`  -DCMAKE_BUILD_TYPE=release

note because of cmakelist is made to generate rpm package too you could get some error about dependencies …

now generate with cpack the debian package

cpack ..

Try to fix your kubuntu box with kernel recovery


when you have some problem with your linux box with kubuntu distro you can try fix it with these steps:

    • 1  reboot your pc
    • 2 press SHIFT AT THE BOOT TIME several times just to get the grub menu
    • 2B if you are not able to get the grub’s menu you should edit your grub.cfg like you can see here
    • 3 one you get this screen

 

    • 4 select the first kernel where you can see RECOVERY MODE
    • 5 so wait until you get this


So now if you have a ethernet lan card you should choose netroot
now you have :
a root shell where you can do

sudo apt-get update
 sudo apt-get -f install
 sudo apt-get dist-upgrade 
sudo adduser MYUSERNAME 
sudo adduser MYUSERNAME admin

or in a line

 sudo apt-get update ; sudo apt-get -f install ; sudo apt-get dist-upgrade ; sudo adduser MYUSERNAME ; sudo adduser MYUSERNAME admin 

** note sudo is not needed but… xD i use often sudo so.. xD i like to write sudo lol
these commands should help to fix some normal problems you could have in your linux box, the easier problems at least…

you can do them all or one by one the last 2 create a user and then add that user to admin groups so you will able to use sudo again with the new user…

what if i need to fix a kde problem ? i would try to reinstall kde… but kubuntu-destkop packages doesn’t install every packages 😦

You could try to fix kde reinstalling it , every packages, with https://nowardev.wordpress.com/2010/11/08/reinstall-kde/