LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-03-2013, 06:38 PM   #1
tfnc99
Member
 
Registered: Sep 2012
Posts: 54

Rep: Reputation: Disabled
Restoring Slackware 14 x64 Boot Sector from Disk.


Well, through work I got a copy of Windows FLP (link) and am going to install it on a 40Gig partitioin on my hard drive (end of hard drive) for some gaming (VirtualBox Direct3D... Horrible). Now the sad fact is that Windows cant help but install the MBR.
How do I reinstall LiLo from the CD command line? I am still in Slack and haven't installed it yet.

P.S. Does anyone know if Steam runs on this strange Windows FLP? .NET nor Visual Studio Do (Tested on some Work Workstations, they wont let me test Steam though ;_; ) due to some WIC missing dependencies.

P.S.S The Steam game I want isn't on Linux yet ;_;
 
Old 03-03-2013, 08:57 PM   #2
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
Windows is also going to write a disk signature to the MBR at offset 1B8 (hex). Although you can back up the MBR and then restore it after installing Windows, that could make Windows unable to boot. So, you are better off to reinstall LILO after installing Windows.

To re-install LILO using the Slackware setup disk, do the following.
  • Boot the Slackware 64-bit Setup disk
  • Mount your root partition (replace "sda1" with your root device name)
    Code:
    mount -t ext4 /dev/sda1 /mnt
  • Mount "dev" file-system so you can use "chroot".
    Code:
    mount --bind /dev /mnt/dev
  • Mount "proc" file-system so you can use "chroot".
    Code:
    mount --bind /proc /mnt/proc
  • Mount "sysfs" file-system so you can use "chroot".
    Code:
    mount --bind /sys /mnt/sys
  • Use "chroot" to make your root file-system be the root.
    Code:
    chroot /mnt
  • Edit "lilo.conf" to add a menu entry for Windows
    Code:
    cd /etc
    nano lilo.conf
  • Run the "lilo" command to re-install "lilo"
    Code:
    lilo
  • Exit from the "chroot" shell
    Code:
    exit
  • Un-mount your root file-system.
    Code:
    umount /mnt/sys
    umount /mnt/proc
    umount /mnt/dev
    umount /mnt
  • Reboot by pressing Ctrl+Alt+Delete

Here are the added lines for "lilo.conf" to boot Windows.

Code:
other = /dev/sda2
label = windows
Replace "sda2" with the correct device for your Windows partition (the partition containing "bootmgr" or "ntldr").

If you back up your MBR, be careful. If you or Windows make any partition changes afterward, restoring the MBR will undo those changes. Make any changes such as re-sizing partitions before you back up the MBR.

Here is how to back up the MBR to a file.

Code:
dd if=/dev/sda of=/mbr.bin bs=512 count=1
You can replace "/mbr.bin" with whatever path and file name you want to use for the backup of the MBR sector.

You should make another backup copy of the MBR to a different file before you restore a copy of the MBR.
To restore the MBR from a file use this command.

Code:
dd if=/mbr.bin of=/dev/sda bs=512 count=1
If Windows does not boot after restoring the MBR, you can use a Windows Setup disk to repair the Boot Configuration Database. Choose the option to start a command prompt and then use this command to repair the boot configuration.
Code:
bootrec /rebuildbcd
 
2 members found this post helpful.
Old 03-04-2013, 07:43 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,191

Rep: Reputation: Disabled
Erik_FL, would you be interested to add this as an article on the Slackware Documentation Project? See http://docs.slackware.com/howtos:general_admin:start

Cheers, Eric
 
Old 03-04-2013, 08:19 PM   #4
tfnc99
Member
 
Registered: Sep 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
It worked, (FLP & Booting). Thank You~

One little problem though, Windows is now default, how do I change this?

Last edited by tfnc99; 03-04-2013 at 08:24 PM.
 
Old 03-04-2013, 08:48 PM   #5
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
Originally Posted by tfnc99 View Post
It worked, (FLP & Booting). Thank You~

One little problem though, Windows is now default, how do I change this?
Add an option to "lilo.conf" to specify the default menu entry.

Code:
default=Linux
Replace "Linux" with the name of the desired menu entry. The name of a menu entry is the text following "label=".

You can find information about "lilio.conf" in the man pages or by searching on the Internet.
Code:
man lilo.conf
 
1 members found this post helpful.
Old 03-06-2013, 05:33 PM   #6
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 146

Rep: Reputation: Disabled
There is an easier way to do a chroot. The lilo command has an '-r' option.

To re-install LILO using the Slackware setup disk, do the following.
  • Boot the Slackware 64-bit Setup disk
  • If you can't remember which partition Slackware is on, list all partitions first:
    Code:
    fdisk -l
  • Mount your Slackware partition (replace "sda1" with your Slackware device name)
    Code:
    mount -t ext4 /dev/sda1 /mnt
  • Edit "/mnt/etc/lilo.conf" to add a menu entry for Windows
    Code:
    cd /mnt/etc
    vi lilo.conf
  • Run the "lilo" command to re-install "lilo" while doing a chroot to /mnt
    Code:
    /mnt/sbin/lilo -r /mnt
  • Un-mount your Slackware file-system.
    Code:
    umount /mnt
  • Reboot by pressing Ctrl+Alt+Delete

Last edited by comet.berkeley; 03-06-2013 at 05:37 PM. Reason: clarify the lilo command
 
  


Reply

Tags
mbr, slackware 14, steam


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 13.37 x64 & Windows 7 x64 Dual Boot Issues toolman30044 Slackware 4 08-08-2011 02:39 PM
Restoring RedHat Enterprise Server x64 5.4 Lucas Rey Linux - Newbie 3 07-12-2011 10:55 PM
no login prompt - suse 9.3 x64: installation disk to boot into installed system? shshjun Suse/Novell 2 02-17-2006 11:00 PM
Restoring boot loader (with boot disk?) Kylotan Linux - General 0 07-08-2004 06:29 AM
Add Hard disk for swap space with problems in boot sector rkes7 Linux - Hardware 1 01-25-2004 02:41 AM


All times are GMT -5. The time now is 03:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration