*I dont have any RAID disks* Knoppix:/# exit exit root@0[mnt]# lilo -v -v -v -r /mnt/hda5 LILO version 22.5.2, Copyright (C) 1992-1998 Werner Almesberger Development beyond version 21 Copyright (C) 1999-2003 John Coffman Released 01-May-2003, and compiled at 14:25:04 on May 4 2003. raid_setup returns offset = 00000000 ndisk = 0 BIOS Volume S/N Device Reading boot sector from /dev/hda Fatal: open /dev/hda: Permission denied root@0[mnt]# ....................... and also look: root@0[mnt]# mount /dev/root on / type ext2 (rw) /dev/cdrom on /cdrom type iso9660 (ro) /dev/cloop on /KNOPPIX type iso9660 (ro) /ramdisk on /ramdisk type tmpfs (rw,size=201508k) automount(pid242) on /mnt/auto type autofs (rw,fd=6,pgrp=242,minproto=2,maxproto=4) /dev/hda5 on /mnt/hda5 type ext2 (rw,nosuid,nodev) root@0[mnt]# umount /mnt/hda5 umount: /mnt/hda5: device occupato ====> means device busy or not availaible root@0[mnt]# mount /dev/root on / type ext2 (rw) /dev/cdrom on /cdrom type iso9660 (ro) /dev/cloop on /KNOPPIX type iso9660 (ro) /ramdisk on /ramdisk type tmpfs (rw,size=201508k) automount(pid242) on /mnt/auto type autofs (rw,fd=6,pgrp=242,minproto=2,maxproto=4) /dev/hda5 on /mnt/hda5 type ext2 (rw,nosuid,nodev) root@0[mnt]# lsof |grep hda root@0[mnt]# but... root@0[mnt]# dd if=/dev/hda of=MBR.img bs=512 count=1 entrati 1+0 record usciti 1+0 record 512 bytes transferred in 0,029547 seconds (17328 bytes/sec) root@0[mnt]# strings MBR.img LILO LILOu'^h `UUfP fPYX Mt 1 root@0[mnt]# :-| [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => invisibile [ip] => invisiblie@libe [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 6 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> reset mbr by lilo - Linux Setup, Configuration & Administration

reset mbr by lilo - Linux Setup, Configuration & Administration

hi, i have reseted a partition backuped with dd with cat blahblah.dd >> /dev/hda5 but now I have a differente mbr. I havent floppy so that i could use only the cdrom. I loaded knoppix and then i launched lilo with /mnt/hda5/etc/lilo.conf as argument and i also changed every line of lilo.conf with something like /mnt/hda5/boot/boot.d but i doesnt work. Anyone could help me ? I also tryed with rescue cdrom of debian but it crash :-( thx for any help :-)...

  1. #1

    Default reset mbr by lilo

    hi, i have reseted a partition backuped with dd with cat blahblah.dd >>
    /dev/hda5
    but now I have a differente mbr.
    I havent floppy so that i could use only the cdrom.
    I loaded knoppix and then i launched lilo with /mnt/hda5/etc/lilo.conf as
    argument and i also changed every line of lilo.conf with something like
    /mnt/hda5/boot/boot.d but i doesnt work.
    Anyone could help me ?
    I also tryed with rescue cdrom of debian but it crash :-(
    thx for any help :-)

    invisibile Guest

  2. #2

    Default Re: reset mbr by lilo

    Il Tue, 26 Aug 2003 12:50:24 +0200, Eric Moors ha scritto:

    > ? The MBR isn't changed.
    > So I suppose you mean the kernel image you booted previously, or perhaps
    > lilo's second stage loader is on hda5.
    >
    yes, the backup have a differente kernel image so i think that the position
    of kernel stored in the mbr is wrong, isn't it ?
    Anyway after the partition was been restored i've got a numbers o hex code
    at boot time... something like:
    F9 F9 F9 F9 F9 F9 F9 F9 F9 F9 F9 F9 F9 F9 F9
    looping continuosly...
    (without any LI or LILO before the hex codes)
    > chroot to /mnt/hda5, restore lilo.conf and run lilo.
    >
    Knoppix:/# /sbin/lilo
    Fatal: open /dev/hda: Permission denied
    Knoppix:/# /sbin/lilo -q ## as say the crash mini-howto
    Warning: '/proc/partitions' does not exist, disk scan bypassed
    Fatal: open /dev/hda5: Permission denied


    invisibile Guest

  3. #3

    Default Re: reset mbr by lilo

    Il Tue, 26 Aug 2003 11:50:15 +0000, Peter T. Breuer ha scritto:

    >> Fatal: open /dev/hda: Permission denied
    >
    > Why hda, anyway? Shouldn't it be hdb?
    >
    knoppix0[knoppix]$ su -
    root0[root]# id
    uid=0(root) gid=0(root) gruppi=0(root)
    root0[root]# mount /mnt/hda5/
    root0[root]# chroot /mnt/hda5
    Knoppix:/# /sbin/lilo
    Fatal: open /dev/hda: Permission denied
    Knoppix:/# mount -t proc none /proc/
    Knoppix:/# /sbin/lilo
    Fatal: open /dev/hda: Permission denied
    Knoppix:/# ls -l /dev/hda5
    brw-rw---- 1 root disk 3, 5 Mar 14 2002 /dev/hda5
    Knoppix:/# ls -l /dev/hda
    brw-rw---- 1 root disk 3, 0 Mar 14 2002 /dev/hda
    Knoppix:/#
    invisibile Guest

  4. #4

    Default Re: reset mbr by lilo

    invisibile <invisiblielibero.it> wrote:
    > Il Tue, 26 Aug 2003 11:50:15 +0000, Peter T. Breuer ha scritto:
    >>> Fatal: open /dev/hda: Permission denied
    >> Why hda, anyway? Shouldn't it be hdb?
    > knoppix0[knoppix]$ su -
    > root0[root]# id
    > uid=0(root) gid=0(root) gruppi=0(root)
    > root0[root]# mount /mnt/hda5/
    What? Where? Let's be charitable and suppose it's hda5 you mount there.
    Ourput of mount?
    > root0[root]# chroot /mnt/hda5
    > Knoppix:/# /sbin/lilo
    > Fatal: open /dev/hda: Permission denied
    Show us /dev/hda (i.e. /mnt/hda5/dev/hda). Why hda, anyway?
    > Knoppix:/# mount -t proc none /proc/
    OK. And is it mounted?
    > Knoppix:/# /sbin/lilo
    > Fatal: open /dev/hda: Permission denied
    Run lilo with more -v's. And don't do the chroot, but do do it
    with -r /mnt/hda5. Why hda5 anyway?

    One would guess that it is already mounted elsewhere. Mounting it
    readonly wouldn't account for it. Curious.
    > Knoppix:/# ls -l /dev/hda5
    > brw-rw---- 1 root disk 3, 5 Mar 14 2002 /dev/hda5
    But is this under the chroot?
    > Knoppix:/# ls -l /dev/hda
    > brw-rw---- 1 root disk 3, 0 Mar 14 2002 /dev/hda
    > Knoppix:/#
    I have no theory. Run strace and see what the problem with lilo is.


    Peter
    Peter T. Breuer Guest

  5. #5

    Default Re: reset mbr by lilo

    invisibile wrote:
    > root0[root]# mount /mnt/hda5/
    I'm not sure exactly what you are doing,
    but the normal command is something like
    mount /dev/hda5 /mnt

    --
    Timothy Murphy
    e-mail: [email]timbirdsnest.maths.tcd.ie[/email]
    tel: +353-86-233 6090
    s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
    Timothy Murphy Guest

  6. #6

    Default Re: reset mbr by lilo

    >> root0[root]# mount /mnt/hda5/
    >
    > What? Where? Let's be charitable and suppose it's hda5 you mount there.
    > Ourput of mount?
    >
    >> root0[root]# chroot /mnt/hda5
    >> Knoppix:/# /sbin/lilo
    >> Fatal: open /dev/hda: Permission denied
    >
    > Show us /dev/hda (i.e. /mnt/hda5/dev/hda). Why hda, anyway?
    everything after the chroot was chrooted so that ls -l /dev/hda was ls -l
    /mnt/hda5/dev/hda
    Why hda? because hda is my primary ide disk.. IMHO i dont understand why
    your question.

    >
    >> Knoppix:/# mount -t proc none /proc/
    >
    > OK. And is it mounted?
    >
    Ofcourse:

    root0[mnt]# chroot hda5/
    Knoppix:/# mount -t proc none /proc/
    Knoppix:/# mount
    /dev/hda5 on / type ext2 (rw,errors=remount-ro)
    proc on /proc type proc (rw)
    none on /proc type proc (rw)
    none on /proc type proc (rw)
    none on /proc type proc (rw)
    Knoppix:/# /sbin/lilo -v -v -v
    LILO version 22.5.7.1, Copyright (C) 1992-1998 Werner Almesberger
    Development beyond version 21 Copyright (C) 1999-2003 John Coffman
    Released 16-Aug-2003, and compiled at 15:20:38 on Aug 17 2003
    Compiled for Debian GNU/Linux.

    raid_setup returns offset = 00000000 ndisk = 0
    BIOS VolumeID Device
    Reading boot sector from /dev/hda
    Fatal: open /dev/hda: Permission denied


    --> *I dont have any RAID disks*

    Knoppix:/# exit
    exit
    root0[mnt]# lilo -v -v -v -r /mnt/hda5
    LILO version 22.5.2, Copyright (C) 1992-1998 Werner Almesberger
    Development beyond version 21 Copyright (C) 1999-2003 John Coffman
    Released 01-May-2003, and compiled at 14:25:04 on May 4 2003.

    raid_setup returns offset = 00000000 ndisk = 0
    BIOS Volume S/N Device
    Reading boot sector from /dev/hda
    Fatal: open /dev/hda: Permission denied
    root0[mnt]#


    .......................

    and also look:

    root0[mnt]# mount
    /dev/root on / type ext2 (rw)
    /dev/cdrom on /cdrom type iso9660 (ro)
    /dev/cloop on /KNOPPIX type iso9660 (ro)
    /ramdisk on /ramdisk type tmpfs (rw,size=201508k)
    automount(pid242) on /mnt/auto type autofs (rw,fd=6,pgrp=242,minproto=2,maxproto=4)
    /dev/hda5 on /mnt/hda5 type ext2 (rw,nosuid,nodev)
    root0[mnt]# umount /mnt/hda5
    umount: /mnt/hda5: device occupato ====> means device busy or not availaible
    root0[mnt]# mount
    /dev/root on / type ext2 (rw)
    /dev/cdrom on /cdrom type iso9660 (ro)
    /dev/cloop on /KNOPPIX type iso9660 (ro)
    /ramdisk on /ramdisk type tmpfs (rw,size=201508k)
    automount(pid242) on /mnt/auto type autofs (rw,fd=6,pgrp=242,minproto=2,maxproto=4)
    /dev/hda5 on /mnt/hda5 type ext2 (rw,nosuid,nodev)
    root0[mnt]# lsof |grep hda
    root0[mnt]#

    but...

    root0[mnt]# dd if=/dev/hda of=MBR.img bs=512 count=1
    entrati 1+0 record
    usciti 1+0 record
    512 bytes transferred in 0,029547 seconds (17328 bytes/sec)
    root0[mnt]# strings MBR.img
    LILO
    LILOu'^h
    `UUfP
    fPYX
    Mt 1
    root0[mnt]#

    :-|



    invisibile Guest

  7. #7

    Default Re: reset mbr by lilo

    Il Tue, 26 Aug 2003 22:42:59 +0100, Timothy Murphy ha scritto:
    > invisibile wrote:
    >
    >> root0[root]# mount /mnt/hda5/
    >
    root0[mnt]# grep hda /etc/fstab
    /dev/hda5 /mnt/hda5 ext2 noauto,users,exec 0 0
    /dev/hda6 /mnt/hda6 ext2 noauto,users,exec 0 0
    /dev/hda7 /mnt/hda7 ext2 noauto,users,exec 0 0
    /dev/hda8 /mnt/hda8 ext2 noauto,users,exec 0 0
    /dev/hda9 none swap defaults 0 0
    root0[mnt]#


    invisibile Guest

  8. #8

    Default Re: reset mbr by lilo

    On Tue, 26 Aug 2003 21:27:26 +0200, invisibile wrote:
    > Il Tue, 26 Aug 2003 11:50:15 +0000, Peter T. Breuer ha scritto:
    >
    >
    >>> Fatal: open /dev/hda: Permission denied
    >>
    >
    >> Why hda, anyway? Shouldn't it be hdb?
    >>
    >
    > knoppix0[knoppix]$ su -
    > root0[root]# id
    > uid=0(root) gid=0(root) gruppi=0(root)
    > root0[root]# mount /mnt/hda5/
    > root0[root]# chroot /mnt/hda5
    > Knoppix:/# /sbin/lilo
    > Fatal: open /dev/hda: Permission denied
    > Knoppix:/# mount -t proc none /proc/
    > Knoppix:/# /sbin/lilo
    > Fatal: open /dev/hda: Permission denied
    > Knoppix:/# ls -l /dev/hda5
    > brw-rw---- 1 root disk 3, 5 Mar 14 2002 /dev/hda5
    > Knoppix:/# ls -l /dev/hda
    > brw-rw---- 1 root disk 3, 0 Mar 14 2002 /dev/hda
    > Knoppix:/#
    what does `id` return after the chroot?

    Eric
    Eric Moors Guest

  9. #9

    Default Re: reset mbr by lilo

    In article <pan.2003.08.26.19.22.28.840609libero.it>,
    invisibile <invisiblielibero.it> wrote:
    :knoppix0[knoppix]$ su -
    :root0[root]# id
    :uid=0(root) gid=0(root) gruppi=0(root)
    :root0[root]# mount /mnt/hda5/
    :root0[root]# chroot /mnt/hda5
    :Knoppix:/# /sbin/lilo
    :Fatal: open /dev/hda: Permission denied
    :Knoppix:/# mount -t proc none /proc/
    :Knoppix:/# /sbin/lilo
    :Fatal: open /dev/hda: Permission denied
    :Knoppix:/# ls -l /dev/hda5
    :brw-rw---- 1 root disk 3, 5 Mar 14 2002 /dev/hda5
    :Knoppix:/# ls -l /dev/hda
    :brw-rw---- 1 root disk 3, 0 Mar 14 2002 /dev/hda
    :Knoppix:/#

    My guess is that /mnt/hda5 has been mounted with the "nodev" option.
    Check your /etc/fstab.

    --
    Bob Nichols [email]rnicholsinteraccess.com[/email]
    rnichols@interaccess.com Guest

  10. #10

    Default Re: reset mbr by lilo

    [email]rnicholsinteraccess.com[/email] wrote:
    > In article <pan.2003.08.26.19.22.28.840609libero.it>,
    > invisibile <invisiblielibero.it> wrote:
    > :knoppix0[knoppix]$ su -
    > :root0[root]# id
    > :uid=0(root) gid=0(root) gruppi=0(root)
    > :root0[root]# mount /mnt/hda5/
    > :root0[root]# chroot /mnt/hda5
    > :Knoppix:/# /sbin/lilo
    > :Fatal: open /dev/hda: Permission denied
    > :Knoppix:/# mount -t proc none /proc/
    > :Knoppix:/# /sbin/lilo
    > :Fatal: open /dev/hda: Permission denied
    > :Knoppix:/# ls -l /dev/hda5
    > :brw-rw---- 1 root disk 3, 5 Mar 14 2002 /dev/hda5
    > :Knoppix:/# ls -l /dev/hda
    > :brw-rw---- 1 root disk 3, 0 Mar 14 2002 /dev/hda
    > :Knoppix:/#
    > My guess is that /mnt/hda5 has been mounted with the "nodev" option.
    > Check your /etc/fstab.
    Good idea. Would be unusual (he needs user or users to force that).

    I rather incline to the view that his kernel is a miracle kernel that
    has detected that the FS is doubly mounted (once as root, and once
    in his mount here), and as a result is complaining like mad.

    Peter
    Peter T. Breuer Guest

Similar Threads

  1. Booting 2nd HDD from Lilo
    By Darsin in forum Linux Setup, Configuration & Administration
    Replies: 5
    Last Post: August 15th, 07:33 AM
  2. Lilo Problems
    By Jefferson Cowart in forum Debian
    Replies: 7
    Last Post: August 12th, 05:10 AM
  3. Understanding LILO
    By Andrés Roldán in forum Debian
    Replies: 0
    Last Post: July 29th, 08:00 PM
  4. Problems with Lilo installation
    By Matthias Roeder in forum Linux Setup, Configuration & Administration
    Replies: 2
    Last Post: July 20th, 04:50 PM
  5. LILO --> GRUB
    By Kenneth Jacker in forum Debian
    Replies: 5
    Last Post: July 8th, 08:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •