Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
Vaše pomoc je stále potřeba!

Autor Téma: Obnova grub po smazani vadnych oddilu [vyřešeno]  (Přečteno 1444 krát)

dinamit

  • Návštěvník
  • Příspěvků: 3
Obnova grub po smazani vadnych oddilu [vyřešeno]
« kdy: 18 Července 2011, 16:57:44 »
Ahoj,

mela jsem ve svem PC dve distribuce Ubuntu - rozbitou 9.10 a novejsi 10.04 + windows XP. Protoze mi 9.10 delala problemy s aktualizacema, rozhodla jsem se ji smazat. Ovsem po smazani oddilu se mi nenacetl grub. Postupovala jsem tedy podle navodu http://wiki.ubuntu.cz/GRUB2#Obnoven.2BAO0_GRUB2_pomoc.2BAO0_LiveCD , ktery mi nepomohl - pri prikazu chroot hlasi, ze nemuze nalezt soubr. Zkusila jsem tedy druhy navod http://forum.ubuntu.cz/index.php?topic=42267.0 , ktery probehl uspesne. Ovsem ouha, grub znovu nenabehl, vypsal hlasku "Minimal bash like line editing is supported.  For the first word Tab lists possible command completion. Anywhere else tab lists possible device / file completions". Na netu jsem nasla nasledujici navod:

grub> root (hd0,X)
# where X is the sdaX where /boot is #
# if you are unsure of X, you can #
# "ls", "ls hd(0,Y)", "ls hd(0,Y)/boot", "ls hd(0,Y)/boot/grub" #
# to find the correct X #
sh:grub> insmod /boot/grub/ext2.mod
sh:grub> linux /boot/vmlinuz-2.6.x.x root=/dev/sdaX ro
# where sdaX is the correct Ubuntu partition #
# where vmlinuz-2.6.x.x is the correct kernel #
sh:grub> initrd /boot/initrd.img-2.6.x.x
# where initrd.img-2.6.x.x is the correct initrd #
sh:grub> boot

vyzkousela jsem ho, jenze jsem se ted zasekla na prikazu linux /boot/vmlinuz-2.6.x.x root=/dev/sdaX ro . Pise mi to "file not found". Ted uz jsem skutecne v koncich, protoze nevim jak dal.

Verze grubu je 1.98

Predem moc diky za vase napady!

Dinamit
« Poslední změna: 19 Července 2011, 20:23:10 od Martin Kiklhorn »

daysleeper

  • Stálý člen
  • **
  • Příspěvků: 1206
Re: Obnova grub po smazani vadnych oddilu
« Odpověď #1 kdy: 18 Července 2011, 19:58:36 »
dej tady prosim vypis z boot_info_script, at mame vic informaci
http://wiki.ubuntu.cz/boot_info_script

Martin Kiklhorn

  • Člen občanského sdružení Ubuntu ČR a placené komunitní podpory
  • Administrátor fóra
  • Závislák
  • ******
  • Příspěvků: 4807
  • グーグル!ご存知ですか?
    • HEJ
Re: Obnova grub po smazani vadnych oddilu
« Odpověď #2 kdy: 18 Července 2011, 22:03:03 »
sdaX = namísto X číslo oddílu
Jsou ve vašem dotazu OPRAVDU VŠECHNY vám dostupné informace o problému?
Linux user since 2007-10-11, Registered #456007
Virtual
| Distribuce
~/slozka znamená /home/"vase jmeno"/slozka
6521 69DE 0F34 FCBC FB1D  DE76 360E 52B2 F71A B8E8

dinamit

  • Návštěvník
  • Příspěvků: 3
Re: Obnova grub po smazani vadnych oddilu
« Odpověď #3 kdy: 18 Července 2011, 22:40:57 »
Přidávám výpis podle návodu.

To Martin: Vím, zadávala jsem root (hd0,7).

Doplním ještě, že oddíly pro Ubuntu 10.04 byly původně sda8 a sda9, jenže smazáním těch druhých oddílů se automaticky přejmenovaly na sda6 a sda7. Tak jestli v tom nemůže být také problém.

Kód: [Vybrat]
                 

Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector
    1 of the same hard drive for core.img. core.img is at this location and
    looks in partition 7 for /boot/grub.
 => Syslinux MBR (3.61-4.03) is installed in the MBR of /dev/sdb.
 => Windows is installed in the MBR of /dev/sdc.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  Windows XP
    Boot files:        /boot.ini /ntldr /NTDETECT.COM

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda3: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

sda6: __________________________________________________________________________

    File system:       ext3
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 10.04 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda7: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  
    Boot files:        /boot/grub/core.img

sdb1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  SYSLINUX 4.01 debian-20100714 ...........>...r>.........$....0...~.k...~...f...M.f.f....f..8~....>2}
    Boot sector info:   Syslinux looks at sector 1434528 of /dev/sdb1 for its
                       second stage. SYSLINUX is installed in the  directory.
                       The integrity check of the ADV area failed. According
                       to the info in the boot sector, sdb1 starts at sector
                       0. But according to the info from fdisk, sdb1 starts
                       at sector 63.
    Operating System:  
    Boot files:        /syslinux/syslinux.cfg /ldlinux.sys

sdc1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows XP: FAT32
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *             63   102,028,814   102,028,752   7 NTFS / exFAT / HPFS
/dev/sda2         102,028,815   102,671,414       642,600   7 NTFS / exFAT / HPFS
/dev/sda3         102,671,539   625,137,344   522,465,806   5 Extended
/dev/sda5         581,183,568   593,874,854    12,691,287  82 Linux swap / Solaris
/dev/sda6         126,110,313   149,547,812    23,437,500  83 Linux
/dev/sda7         149,549,056   581,183,487   431,634,432  83 Linux


Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 4009 MB, 4009230336 bytes
255 heads, 63 sectors/track, 487 cylinders, total 7830528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1    *             63     7,823,654     7,823,592  83 Linux


Drive: sdc _____________________________________________________________________

Disk /dev/sdc: 16.0 GB, 16039018496 bytes
60 heads, 40 sectors/track, 13052 cylinders, total 31326208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdc1    *          2,152    31,326,207    31,324,056   c W95 FAT32 (LBA)


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs  
/dev/loop1       7875871f-abb6-4452-b70b-a345f260a56f   ext3      
/dev/sda1        05D6DE0F14D5E510                       ntfs       SYSTEMWIN
/dev/sda2        3149E48E108E35E9                       ntfs       DATA
/dev/sda5        fdcbc417-c898-4c9b-af5d-5a9940be2bbb   swap      
/dev/sda6        5c4b568a-fdce-4293-87cc-eb7180cd7fde   ext3      
/dev/sda7        b3575ef5-0ffd-4f61-81b8-b3b5006bea1b   ext4      
/dev/sdb1        7B3E-A630                              vfat      
/dev/sdc1        64A2-362D                              vfat       CORSAIR

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sdb1        /cdrom                   vfat       (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdc1        /media/CORSAIR           vfat       (rw,nosuid,nodev,uhelper=udisks,uid=999,gid=999,shortname=mixed,dmask=0077,utf8=1,showexec,flush)


================================ sda1/boot.ini: ================================

--------------------------------------------------------------------------------
[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect

--------------------------------------------------------------------------------

=========================== sda6/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
  set saved_entry=${prev_saved_entry}
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set 5c4b568a-fdce-4293-87cc-eb7180cd7fde
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set 5c4b568a-fdce-4293-87cc-eb7180cd7fde
set locale_dir=($root)/boot/grub/locale
set lang=cs
insmod gettext
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set 5c4b568a-fdce-4293-87cc-eb7180cd7fde
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5c4b568a-fdce-4293-87cc-eb7180cd7fde ro   quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set 5c4b568a-fdce-4293-87cc-eb7180cd7fde
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5c4b568a-fdce-4293-87cc-eb7180cd7fde ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set 5c4b568a-fdce-4293-87cc-eb7180cd7fde
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set 5c4b568a-fdce-4293-87cc-eb7180cd7fde
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 05d6de0f14d5e510
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Ubuntu, Linux 2.6.31-16-generic (on /dev/sda6)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef
linux /boot/vmlinuz-2.6.31-16-generic root=UUID=d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef ro quiet splash
initrd /boot/initrd.img-2.6.31-16-generic
}
menuentry "Ubuntu, Linux 2.6.31-16-generic (recovery mode) (on /dev/sda6)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef
linux /boot/vmlinuz-2.6.31-16-generic root=UUID=d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef ro single
initrd /boot/initrd.img-2.6.31-16-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (on /dev/sda6)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode) (on /dev/sda6)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=d85d6f0d-3bcb-4dbb-91fd-2b109fe7cdef ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (on /dev/sda7)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set cf4b2a4b-83ad-4cb0-aaa3-687abeeaf9c7
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cf4b2a4b-83ad-4cb0-aaa3-687abeeaf9c7 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode) (on /dev/sda7)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set cf4b2a4b-83ad-4cb0-aaa3-687abeeaf9c7
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cf4b2a4b-83ad-4cb0-aaa3-687abeeaf9c7 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
--------------------------------------------------------------------------------

=============================== sda6/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/sda8       /               ext3    errors=remount-ro 0       1
# /home was on /dev/sda9 during installation
UUID=b3575ef5-0ffd-4f61-81b8-b3b5006bea1b /home           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=fdcbc417-c898-4c9b-af5d-5a9940be2bbb none            swap    sw              0       0
--------------------------------------------------------------------------------

=================== sda6: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

  63.391987324 = 68.066628096   boot/grub/core.img                             1
  63.470112324 = 68.150514176   boot/grub/grub.cfg                             1
  63.477543354 = 68.158493184   boot/initrd.img-2.6.32-21-generic              3
  63.484573841 = 68.166042112   boot/vmlinuz-2.6.32-21-generic                 2
  63.477543354 = 68.158493184   initrd.img                                     3
  63.484573841 = 68.166042112   vmlinuz                                        2

=================== sda7: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

  71.450180054 = 76.719046656   boot/grub/core.img                             1

========================= sdb1/syslinux/syslinux.cfg: ==========================

--------------------------------------------------------------------------------
# D-I config version 2.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 50
ui gfxboot bootlogo
--------------------------------------------------------------------------------

================= sdb1: Location of files loaded by Syslinux: ==================

           GiB - GB             File                                 Fragment(s)

            ?? = ??             ldlinux.sys                                    1
            ?? = ??             syslinux/gfxboot.c32                           1
            ?? = ??             syslinux/syslinux.cfg                          1
            ?? = ??             syslinux/vesamenu.c32                          1

============== sdb1: Version of COM32(R) files used by Syslinux: ===============

 syslinux/gfxboot.c32               :  COM32R module (v4.xx)
 syslinux/vesamenu.c32              :  COM32R module (v4.xx)

=============================== StdErr Messages: ===============================

/home/ubuntu/Plocha/skript.sh: line 1579: [: 2.73495e+09: integer expression expected
 
« Poslední změna: 18 Července 2011, 23:00:08 od dinamit »

daysleeper

  • Stálý člen
  • **
  • Příspěvků: 1206
Re: Obnova grub po smazani vadnych oddilu
« Odpověď #4 kdy: 18 Července 2011, 23:35:27 »
je tam bohuzel hodne chyb

varianta 1:
  zalohovat dulezita data, smazat sda3 a vyse, nainstalovat ubuntu nacisto vedle stavajicich win oddilu (sda1-2)

varianta2:
  znovu obnovit Grub dle navodu http://forum.ubuntu.cz/index.php?topic=42267.20 s tim, ze prikaz bude
Kód: [Vybrat]
sudo mount /dev/sda6 /mnt
pak je jeste treba opravit soubor /etc/fstab na sda6, aby vypadal takto
Kód: [Vybrat]
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/sda6       /               ext3    errors=remount-ro 0       1
# /home was on /dev/sda9 during installation
UUID=b3575ef5-0ffd-4f61-81b8-b3b5006bea1b /home           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=fdcbc417-c898-4c9b-af5d-5a9940be2[b] none            swap    sw              0       0
to za predpokladu, ze na sda7 mas jeste porad /home

pokud se ti oprava nepodari, dej tu opet novy vypis boot_info_script

dinamit

  • Návštěvník
  • Příspěvků: 3
Re: Obnova grub po smazani vadnych oddilu
« Odpověď #5 kdy: 19 Července 2011, 14:30:41 »
Úžasné, funguje :-) .

Znovu jsem obnovila grub a pak zeditovala ten soubor fstab. Byla tam původní hodnota /dev/sda8.

Moc děkuju za pomoc!
« Poslední změna: 19 Července 2011, 14:35:23 od dinamit »

 

Provoz zaštiťuje spolek OpenAlt.