grub-probe:eror:cannot find a grub

Pertanyaan umum seputar distribusi Ubuntu yang menjadi distro wajib members ubuntu-indonesia.com
User avatar
si_pemula
Posts: 5
Joined: 02 Nov 2010, 23:48
Location: jakarta

grub-probe:eror:cannot find a grub

Postby si_pemula » 26 Jun 2011, 20:53

malem all..ane punya problem nih mohon dibantu (_")

gini gan,,ane kan abis install windows 7 + XP,pastinya ilang kan grub ubuntu ane,,ane pake deh grub-install by cd. tapi ko malah eror ya gan
gini outpoutnya :

grub-probe: eror : cannot find a grub drive for /dev/sdc6. check your device map.

ane dah muter2 segala cara ane dah cobain,,tapi belom nemu juga,,mohon dibantu ya all..
User avatar
Hellnest
Posts: 198
Joined: 13 Oct 2010, 19:15
Contact:

Re: grub-probe:eror:cannot find a grub

Postby Hellnest » 26 Jun 2011, 21:30

Chroot untuk perbaikin grub, misalkan partisi root ubuntu kamu ada di sdc6 caranya gini

Code: Select all

Buat akses root biar gampang $ sudo passwd masukin password baru untuk root, 2x. Setelah itu $ su Masukin password yg baru tadi :) -- Chroot # mount /dev/sdc6 /mnt # mount -t proc /proc /mnt/proc # mount -o bind /dev /mnt/dev # mount -o bind /sys /mnt/sys # chroot /mnt -- Sekarang kamu udah ada dalem env ubuntu kamu. Kita repair grubnya # grub-install --no-floppy /dev/sdc jangan sdc6 tapi sdc, kalo mau install di sda juga terserah kamu. Setelah itu # update-grub # exit ---- kita umount semua yg tadi # umount /mnt/{dev,sys,proc} # umount /mnt reboot,
Regards
Last edited by Hellnest on 27 Feb 2016, 17:18, edited 1 time in total.
Reason: Typo, thanks buat thrvers :)
User avatar
Nexus
Posts: 2957
Joined: 26 Feb 2011, 12:39
Location: Ujung dunia

Re: grub-probe:eror:cannot find a grub

Postby Nexus » 27 Jun 2011, 00:10

seharusnya cukup ini aja:

sudo -s

update-initramfs -u (atau bisa juga update-initramfs all -u)

update-grub/update-burg

reboot
User avatar
Hellnest
Posts: 198
Joined: 13 Oct 2010, 19:15
Contact:

Re: grub-probe:eror:cannot find a grub

Postby Hellnest » 27 Jun 2011, 09:57

http://ubuntuforums.org/showthread.php?t=1581099 <- Thread umum di ubuntuforums.org yg membahas soal repair grub.

@ mastah honeycomb
Monggo di praktekin command km sebelom di share :)

modprobe grub <- emank ada ya module kernel namanya grub? Share donk modulenya ke saya

update-initramfs

Code: Select all

#!/bin/sh STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf USETRIGGERS=true mode="" version="" update_initramfs=yes backup_initramfs=no set -e [ -r ${CONF} ] && . ${CONF} if $USETRIGGERS \ && [ x"${DPKG_MAINTSCRIPT_PACKAGE:-}" != x ] \ && [ $# = 1 ] \ && [ x"$1" = x-u ] \ && dpkg-trigger --check-supported 2>/dev/null then if dpkg-trigger --no-await update-initramfs; then echo "update-initramfs: deferring update (trigger activated)" exit 0 fi fi usage() { if [ -n "${1:-}" ]; then printf "${*}\n\n" >&2 fi cat >&2 << EOF Usage: ${0} [OPTION]... Options: -k [version] Specify kernel version or 'all' -c Create a new initramfs -u Update an existing initramfs -d Remove an existing initramfs -t Take over a custom initramfs with this one -b Set alternate boot directory -v Be verbose -h This message EOF exit 1 } # chroot check chrooted() { # borrowed from udev's postinst if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then # the devicenumber/inode pair of / is the same as that of # /sbin/init's root, so we're *not* in a chroot and hence # return false. return 1 fi return 0 } mild_panic() { if [ -n "${1:-}" ]; then printf "${*}\n" >&2 fi exit 0 } panic() { if [ -n "${1:-}" ]; then printf "${*}\n" >&2 fi exit 1 } verbose() { if [ "${verbose}" = 1 ]; then printf "${*}\n" fi } version_exists() { [ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ] return $? } set_initramfs() { initramfs="${BOOTDIR}/initrd.img-${version}" } # backup initramfs while running backup_initramfs() { [ ! -r "${initramfs}" ] && return 0 initramfs_bak="${initramfs}.dpkg-bak" [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}" ln -f "${initramfs}" "${initramfs_bak}" \ || cp -a "${initramfs}" "${initramfs_bak}" verbose "Keeping ${initramfs_bak}" } # keep booted initramfs backup_booted_initramfs() { initramfs_bak="${initramfs}.dpkg-bak" # first time run thus no backup [ ! -r "${initramfs_bak}" ] && return 0 # chroot with no /proc [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 # no kept backup wanted [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0 # no backup yet if [ ! -r "${initramfs}.bak" ]; then mv -f ${initramfs_bak} "${initramfs}.bak" verbose "Backup ${initramfs}.bak" return 0 fi # keep booted initramfs boot_initramfs= uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime) if [ -n "$uptime_days" ]; then boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days}) fi if [ -n "${boot_initramfs}" ]; then mv -f "${initramfs_bak}" "${initramfs}.bak" verbose "Backup ${initramfs}.bak" return 0 fi verbose "Removing current backup ${initramfs_bak}" rm -f ${initramfs_bak} } # nuke generated copy remove_initramfs_bak() { [ -z "${initramfs_bak:-}" ] && return 0 rm -f "${initramfs_bak}" verbose "Removing ${initramfs_bak}" } generate_initramfs() { echo "update-initramfs: Generating ${initramfs}" OPTS="-o" if [ "${verbose}" = 1 ]; then OPTS="-v ${OPTS}" fi if mkinitramfs ${OPTS} "${initramfs}.new" "${version}"; then mv -f "${initramfs}.new" "${initramfs}" set_sha1 else mkinitramfs_return="$?" remove_initramfs_bak rm -f "${initramfs}.new" if [ "$mkinitramfs_return" = "2" ]; then # minversion wasn't met, exit 0 exit 0 fi echo "update-initramfs: failed for ${initramfs}" >&2 exit $mkinitramfs_return fi } # lilo call run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then echo "ERROR lilo fails for new ${initramfs}:" >&2 echo lilo -t fi lilo } # Invoke bootloader run_bootloader() { # invoke policy conformant bootloader hooks if [ -d /etc/initramfs/post-update.d/ ]; then run-parts --arg=${version} --arg=${initramfs} \ /etc/initramfs/post-update.d/ return 0 fi # FIXME: to be removed postsqueeze release # if both lilo and grub around, figure out if lilo needs to be run if ( command -v update-grub >/dev/null 2>&1 \ || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \ && ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ || [ "${do_b}" = "YES" ]; then run_lilo return 0 elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \ || [ "${do_b}" = "NO" ]; then return 0 fi # do_bootloader unconfigured echo echo "WARNING: grub and lilo installed." echo "Please deinstall unused bootloader." echo return 0 fi if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then run_lilo return 0 fi if [ -r /etc/elilo.conf ] && command -v elilo >/dev/null 2>&1; then elilo return 0 fi if [ -r /etc/zipl.conf ]; then zipl return 0 fi if flash-kernel --supported >/dev/null 2>&1; then flash-kernel ${version} return 0 fi } compare_sha1() { sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1 return $? } # Note that this must overwrite so that updates work. set_sha1() { sha1sum "${initramfs}" > "${STATEDIR}/${version}" } delete_sha1() { rm -f "${STATEDIR}/${version}" } # ro /boot is not modified ro_boot_check() { # check irrelevant inside of a chroot if [ ! -r /proc/mounts ] || chrooted; then return 0 fi boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \ && $2 == "/boot") print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." echo "update-initramfs: Not updating ${initramfs}" exit 0 fi } get_sorted_versions() { version_list="" for gsv_x in "${STATEDIR}"/*; do gsv_x="$(basename "${gsv_x}")" if [ "${gsv_x}" = '*' ]; then return 0 fi worklist="" for gsv_i in $version_list; do if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then worklist="${worklist} ${gsv_x} ${gsv_i}" gsv_x="" else worklist="${worklist} ${gsv_i}" fi done if [ "${gsv_x}" != "" ]; then worklist="${worklist} ${gsv_x}" fi version_list="${worklist}" done verbose "Available versions: ${version_list}" } set_current_version() { if [ -f /boot/initrd.img-`uname -r` ]; then version=`uname -r` fi } set_linked_version() { linktarget= if [ -e /initrd.img ] && [ -L /initrd.img ]; then linktarget="$(basename "$(readlink /initrd.img)")" fi if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then linktarget="$(basename "$(readlink /boot/initrd.img)")" fi if [ -z "${linktarget}" ]; then return fi version="${linktarget##initrd.img-}" } set_highest_version() { get_sorted_versions if [ -z "${version_list}" ]; then version= return fi set -- ${version_list} version=${1} } create() { if [ -z "${version}" ]; then usage "Create mode requires a version argument" fi set_initramfs if [ "${takeover}" = 0 ]; then if version_exists "${version}"; then panic "Cannot create version ${version}: already exists" fi if [ -e "${initramfs}" ]; then panic "${initramfs} already exists, cannot create." fi fi generate_initramfs } update() { if [ "${update_initramfs}" = "no" ]; then echo "update-initramfs: Not updating initramfs." exit 0 fi if [ -z "${version}" ]; then set_highest_version fi if [ -z "${version}" ]; then set_linked_version fi if [ -z "${version}" ]; then set_current_version fi if [ -z "${version}" ]; then verbose "Nothing to do, exiting." exit 0 fi set_initramfs ro_boot_check altered_check backup_initramfs generate_initramfs run_bootloader backup_booted_initramfs } delete() { if [ -z "${version}" ]; then usage "Delete mode requires a version argument" fi set_initramfs if [ "${takeover}" = 0 ]; then if [ ! -e "${initramfs}" ]; then panic "Cannot delete ${initramfs}, doesn't exist." fi if ! version_exists "${version}"; then panic "Cannot delete version ${version}: Not created by this utility." fi fi altered_check echo "update-initramfs: Deleting ${initramfs}" delete_sha1 rm -f "${initramfs}" "${initramfs}.bak" } # Check for update mode on existing and modified initramfs altered_check() { # No check on takeover [ "${takeover}" = 1 ] && return 0 if [ ! -e "${initramfs}" ]; then mild_panic "${initramfs} does not exist. Cannot update." fi if ! compare_sha1; then echo "update-initramfs: ${initramfs} has been altered." >&2 mild_panic "update-initramfs: Cannot update. Override with -t option." fi } # Defaults verbose=0 yes=0 # We default to takeover=1 in Ubuntu, but not Debian takeover=1 ## while getopts "k:cudyvtb:h?" flag; do case "${flag}" in k) version="${OPTARG}" ;; c) mode="c" ;; d) mode="d" ;; u) mode="u" ;; v) verbose="1" ;; y) yes="1" ;; t) takeover="1" ;; b) BOOTDIR="${OPTARG}" if [ ! -d "${BOOTDIR}" ]; then echo "Error: ${BOOTDIR} is not a directory." >&2 exit 1 fi ;; h|?) usage ;; esac done shift $((${OPTIND} - 1)) if [ $# -ne 0 ]; then echo "Invalid argument for option -k." >&2 usage fi # Validate arguments if [ -z "${mode}" ]; then usage "You must specify at least one of -c, -u, or -d." fi if [ "${version}" = "all" ] \ || ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then : FIXME check for --yes, and if not ask are you sure get_sorted_versions if [ -z "${version_list}" ]; then verbose "Nothing to do, exiting." exit 0 fi OPTS="-b ${BOOTDIR}" if [ "${verbose}" = "1" ]; then OPTS="${OPTS} -v" fi if [ "${takeover}" = "1" ]; then OPTS="${OPTS} -t" fi if [ "${yes}" = "1" ]; then OPTS="${OPTS} -y" fi for u_version in ${version_list}; do verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}" "${0}" -${mode} -k "${u_version}" ${OPTS} done exit 0 fi case "${mode}" in c) create ;; d) delete ;; u) update ;; esac
baca aja kegunaan script initramfs itu untuk apa :)

@moderator di close aja threadnya thanks
User avatar
Nexus
Posts: 2957
Joined: 26 Feb 2011, 12:39
Location: Ujung dunia

Re: grub-probe:eror:cannot find a grub

Postby Nexus » 27 Jun 2011, 21:44

sory2.. smalem sibuk banget oprek2.. jd salah gitu.. tangan yg satunya buat ngoprek terminal di pc and tangan yg kiri buat ngoprek terminal dilaptop.. sekali lagi sory, kalo tangan ane satunya itu nakal banget.. hiiks hiiks jadi gak konsen smalem.. udah dihapus..
User avatar
Nexus
Posts: 2957
Joined: 26 Feb 2011, 12:39
Location: Ujung dunia

Re: grub-probe:eror:cannot find a grub

Postby Nexus » 27 Jun 2011, 21:47

malem all..ane punya problem nih mohon dibantu (_")

gini gan,,ane kan abis install windows 7 + XP,pastinya ilang kan grub ubuntu ane,,ane pake deh grub-install by cd. tapi ko malah eror ya gan
gini outpoutnya :

grub-probe: eror : cannot find a grub drive for /dev/sdc6. check your device map.

ane dah muter2 segala cara ane dah cobain,,tapi belom nemu juga,,mohon dibantu ya all..
...

Who is online

Users browsing this forum: No registered users and 7 guests