1

Ситуация - нетбук, на нем стояли Ubuntu 10.10 и винда. Теперь решил подселить к ним еще Backtrack 4 R2. Отрезал кусок от нтфсного диска (не тот который с виндой, просто медиа-диск) поставил на этот кусок бэктрек. Груб он, понятное дело, в процессе установки переписал. В грубе Ubuntu все еще видна, но не грузится (мол нету файла), подозреваю что из-за того что переразбил какие-то разделы переименовались и теперь в МБР указатели не туда куда должны были. Прочитал темы на форуме, везде ситуации когда на винте живут только винда и линь и после переустановки винды затерся груб и надо его восстановить. Советуют сделать вот так для раздела с потерявшимся линуксом:
sudo grub-install --root-directory=/tmp /dev/sda1
Бэктрек у меня вполне нормально грузится, так что я могу сделать это из него, но не перестанет ли он работать если этой командой установлю рут на директорию в которой у меня Ubuntu?
И как правильно сделать чтобы в мбр были ссылки на виндовый раздел, на Ubuntu и на бэктрек?

Disk /dev/disk/by-id/ata-SAMSUNG_HM160HI_S1WWJD0S731375: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0f0af0d0

  Device Boot                                Start         End      Blocks         Id  System
/dev/disk/by-id/ata-part1   *         785        8050    58364141+   7  HPFS/NTFS
/dev/disk/by-id/ata-part2            8051       10058    16129260    5  Extended
/dev/disk/by-id/ata-part3           10059       13705    29294527+  83  Linux
/dev/disk/by-id/ata-part4           13706       19457    46202940    b  W95 FAT32
/dev/disk/by-id/ata-part5            8051        9874    14647296   83  Linux
/dev/disk/by-id/ata-part6            9874       10058     1479680   82  Linux swap / Solaris

part1 - windows
part3 - backtrack
part5 - ubuntu 10.10

Как быть?
П.С. возможно что бэктрек и Ubuntu используют разные версии ГРУБ

2

Покажите /boot/grub/grub.cfg (если нет такого файла, то /boot/grub/menu.lst)

3

Вот, пожалуйста.
/boot/grub/menu.lst

+ открыть спойлер

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=672a12b7-2e11-4af6-b611-9668c3de443d ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=672a12b7-2e11-4af6-b611-9668c3de443d

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=0x317 resume=/dev/hda5
# defoptions=vga=0x317

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

splashimage=672a12b7-2e11-4af6-b611-9668c3de443d/boot/grub/splash.xpm.gz

title        BackTrack 4 R2, kernel 2.6.35.8
uuid        672a12b7-2e11-4af6-b611-9668c3de443d
kernel        /boot/vmlinuz-2.6.35.8 root=UUID=672a12b7-2e11-4af6-b611-9668c3de443d ro quiet splash
initrd        /boot/initrd.img-2.6.35.8
quiet

title        BackTrack 4 R2, kernel 2.6.35.8 (recovery mode)
uuid        672a12b7-2e11-4af6-b611-9668c3de443d
kernel        /boot/vmlinuz-2.6.35.8 root=UUID=672a12b7-2e11-4af6-b611-9668c3de443d ro  single
initrd        /boot/initrd.img-2.6.35.8

title        BackTrack 4 R2, memtest86+
uuid        672a12b7-2e11-4af6-b611-9668c3de443d
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows NT/2000/XP
root        (hd0,0)
savedefault
makeactive
chainloader    +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title        'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)
root        (hd0,4)
kernel        /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro quiet splash
initrd        /boot/initrd.img-2.6.35-23-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title        'Ubuntu, with Linux 2.6.35-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)
root        (hd0,4)
kernel        /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro single
initrd        /boot/initrd.img-2.6.35-23-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title        'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)
root        (hd0,4)
kernel        /boot/vmlinuz-2.6.35-22-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro quiet splash
initrd        /boot/initrd.img-2.6.35-22-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title        'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)
root        (hd0,4)
kernel        /boot/vmlinuz-2.6.35-22-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro single
initrd        /boot/initrd.img-2.6.35-22-generic
savedefault
boot

4

В предыдущем посте я выложил меню.лст который у меня в бэктреке (который благополучно грузится), а вот grub.cfg c раздела убунты который теперь не грузится (это старый загрузчик, который работал до того как я бэктрек установил):

+ открыть спойлер

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by 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
  set have_grubenv=true
  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
}

function load_video {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
set locale_dir=($root)/boot/grub/locale
set lang=ru
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.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    linux    /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro   quiet splash
    initrd    /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    echo    'Loading Linux 2.6.35-23-generic ...'
    linux    /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro single
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro   quiet splash
    initrd    /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    echo    'Loading Linux 2.6.35-22-generic ...'
    linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro single
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sda1)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set 7e70976c70972a43
    drivemap -s (hd0) ${root}
    chainloader +1
}
menuentry "Microsoft Windows XP Professional RU (on /dev/sda5)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set 0814d11914d10b18
    drivemap -s (hd0) ${root}
    chainloader +1
}
### 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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

пользуйтесь тэгами
первое предупреждение
модератор

5

Есть у кого-нибудь какие-то соображения на этот счет? Каким должен быть конфиг загрузчика чтобы Ubuntu заработала?

6

Поправьте в /boot/grub/grub.cfg (ubuntu)

menuentry 'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    linux    /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro   quiet splash
    initrd    /boot/initrd.img-2.6.35-23-generic
}

msdos6 на
msdos5

7

Спасибо за то что откликнулись.
Поправил, но по-прежнему - Error 15: File not found ac

8

Покажите вывод

 Консоль:
sudo blkid

я так понимаю Ubuntu 10.10 юзает grub2...
неужели у бэктрэка тоже груб2?
я так понимаю бэктрэк подправил груб на свой конфиг и править надо конфиг в бэктрэке...

10

Вот вывод blkid:
/dev/sda1: UUID="7E70976C70972A43" TYPE="ntfs"
/dev/sda5: UUID="5cc8c65e-9d0c-487b-83c1-996e08b1fac5" TYPE="ext4"
/dev/sdb5: UUID="532464e8-0659-436e-8b50-0fb0290abbb2" TYPE="swap"
/dev/sda3: UUID="672a12b7-2e11-4af6-b611-9668c3de443d" TYPE="ext3"
/dev/sda4: UUID="87EF-B288" TYPE="vfat"
/dev/sdb1: LABEL="ZUKO_UNO" UUID="7C66-373B" TYPE="vfat"
/dev/sda6: TYPE="swap" UUID="4c7ef81b-4b55-4775-9a58-292172d1720b"

2Харитон
в бэктректе grub --version -  grub (GNU GRUB 0.97)

Почитал вообще как процесс загрузки происходит, комп лезет в раздел MBR на винчестере, в этом разделе есть указатель на раздел с которого производить загрузку (а я думал что там ссылки на все разделы на которых операционки стоят). В моем случае там адрес бэктрека, комп идет по этому адресу и начинает исполняться код grub'а. В этот момент мы видим табличку с выбором операционки, которые груб опираясь на свой конфиг может загрузить. Если выбрать бэктрек, то начинает выполняться код ядра (??? в конфиге вроде только на ядро указатель). Фактически, если что-то изменить в конфиге убунтушного груба, то ничего не изменится в любом случае, так как убунтушный груб не выполняется.
Насколько я понимаю нужно изменить инструкции к загрузке убунты в конфиге бэктрековского груба.
Т.е. надо сделать чтобы вот это:

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title        'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os { (on /dev/sda5)
root        (hd0,4)
kernel        /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro quiet splash
initrd        /boot/initrd.img-2.6.35-23-generic
savedefault
boot

Работало так же как и это:

menuentry 'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 5cc8c65e-9d0c-487b-83c1-996e08b1fac5
    linux    /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro   quiet splash
    initrd    /boot/initrd.img-2.6.35-23-generic
}

Т.е. переписать загрузочные инструкции с grub2 под 0.97. Ну и с учетом некоторых изменившихся разделов. Знает кто-нибудь как переписать таким образом? И возможно это нужно делать это не лезя в сам конфиг, через интерфейсы груба (хотя в конфиге бэктрековского вроде не написано DO NOT EDIT THIS FILE, как в убунтушном)?

11

Первый GRUB можно (и нужно) редактировать вручную.
Второй не рекомендуется  редактировать вручную, редактировать надо /etc/default/grub и конфиги лежащие в /etc/grub.d/.

12

Если попробовать закомментировать пока строки с Ubuntu в /boot/grub/menu.lst
А вместо них прописать

title        Ubuntu, with Linux 2.6.35-23-generic
uuid         5cc8c65e-9d0c-487b-83c1-996e08b1fac5
kernel        /boot/vmlinuz-2.6.35-23-generic root=UUID=5cc8c65e-9d0c-487b-83c1-996e08b1fac5 ro quiet splash
initrd        /boot/initrd.img-2.6.35-23-generic
savedefault
boot

13

2 durc
аналогично, файл нот фаунд.
Поэкспереминтировал с груб легаси (который в бэктреке), тут консолька есть грубовская, через нее и так и эдак параметрами крутил, но так и не получилось загрузиться ac
Ща попробую проапдейтить до груб2, надеюсь он сам корректно все загрузочные пути выставит.

14

Обновил до grub2, чуда не случилось ab Ну зато теперь у обоих систем одинаковые загрузчики, и по второму грубу отличный вики-учебник на русском ab

15

а как узнать который у тебя груб? например, у меня минт-росинка

друзья, давайте заменим чсВ на ЧСД!
Проблемы. Глюки. Красные глаза. Так будет с каждым, кто не хочет сменить Ubuntu на минт-росинку9
Знаю, что росинка - внучка убунты, значит, неизбежны родимые пятна. Но бабулька-то куда страшнее!
Но наш слакварь стоит на запасном пути. Он ждет своего часа. Может, когда док вернется из бана?

16

 Консоль:
# grub --version
grub (GNU GRUB 0.97)

17

zuko_uno пишет:

Обновил до grub2, чуда не случилось ab Ну зато теперь у обоих систем одинаковые загрузчики, и по второму грубу отличный вики-учебник на русском ab

попробуй изменить insmod ext2 на insmod ext4
стоит ли os-probe
зачем держать 10 загрузчиков? настроить grub2 и радоваться ))