LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-24-2010, 12:24 PM   #1
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
Cannot boot without my second hard drive


I have two SATA hard drives in my slackware 13.1_64 Desktop.

On 1. Drive I have 3 partitions for Win 7:
/dev/sda1 - Some Win 7 boot partition
/dev/sda2 - Win7
/dev/sda3 - Data partition

On 2. Drive I have 3 partitions for slackware and WinXP:
/dev/sdb1 - Win XP
/dev/sdb2 - Slackware root partition
/dev/sdb3 - Swap

When I disconnect my first drive (Win 7) I cannot boot into slackware. I cannot boot with the Slackware DVD into my root partition too (huge.s root=/dev/sdb2 rdinit= ro).
It gives me single user console but only with read access. I want to remove the Win 7 drive from my Desktop and put into a new (empty) one.
It seems to me that the boot record is on that first drive. How can I make to boot my Desktop with the slackware drive only? This is my lilo.conf:
Quote:
boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
append=" vt.default_utf8=0"
prompt
timeout = 50
vga = 773

image = /boot/vmlinuz
root = /dev/sdb2
label = linux
read-only # Partitions should be mounted read-only for checking

other = /dev/sdb1
label = winXP
table = /dev/sdb

other = /dev/sda1
label = win7
table = /dev/sda
 
Old 06-24-2010, 12:28 PM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
if you disconnect your first drive, when booting from the dvd you have to pass /dev/sda2 instead of /dev/sdb2 to lilo, as the remaining drive will be seen as the first
Code:
huge.s root=/dev/sda2
you can check what is seen also booting into the install shell and then issue a
Code:
fdisk -l
when you have booted fix /etc/fstab, /etc/lilo.conf and reinstall it with
Code:
lilo

Last edited by ponce; 06-24-2010 at 12:30 PM.
 
Old 06-24-2010, 12:29 PM   #3
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
If you remove your first harddisk (sda), the second harddisk will not be called sdb but sda instead. So try to install lilo on your second harddrive too and eventually add entries for your linux with sdb replaced with sda. Perhaps you will need to modify your /etc/fstab too.

However, it helps a lot, if you post some messages or errors printed on the screen.
 
Old 06-24-2010, 12:31 PM   #4
Thom1b
Member
 
Registered: Mar 2010
Location: France
Distribution: Slackware
Posts: 484

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
When you disconnect sda, sdb becomes sda so you have to modify your lilo.conf and /etc/fstab using slackDVD for example (huge.s root=/dev/sda2).
If you disconnect often sda but never sdb, I suggest you to switch sda and sdb definitively.
 
Old 06-24-2010, 12:43 PM   #5
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Original Poster
Rep: Reputation: 78
Oops. Sorry, that was a mistake. I was booting into sda2 after replacing the drive. I always check it by cfdisk which partition is what. I cannot exactly remember the message it gives - I am going to reboot my Desktop again and read it.
 
Old 06-25-2010, 02:44 AM   #6
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Original Poster
Rep: Reputation: 78
It stops at the point where the system tries to check the root partition with e2fsck. It shows that the e2fsck cannot be found because the partition /dev/sdb2 cannot be accessed.
This happens when I try to boot my root partition with the slackware cd (with one drive). As noted above huge.s root=/dev/sda2 rdinit= ro.
After the e2fsck fails, I get a prompt for system administration. Where it tells I can solve the problem but I cannot even reinstall lilo after login. The partition is mounted read only.
I don't understand why it tries to find /dev/sdb2!?
The only way I can reinstall the lilo (because I cannot boot into my root partition with one drive) is to boot the system with two drives. In this case I need to have the Slackware drive at the second SATA port (/dev/sdb) because if it is reverse it fails to boot too.

I changed the lilo.conf to this:
Quote:
boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
append=" vt.default_utf8=0"
prompt
timeout = 50
vga = 773

image = /boot/vmlinuz
root = /dev/sda2
label = linux
read-only # Partitions should be mounted read-only for checking
Reinstalled it. With some warnings but no errors so I cannot see any reason why to search for partition /dev/sdb2. (??)

Question: Where lilo installs the booting configuration?? (With one and two drives)
 
Old 06-25-2010, 05:50 AM   #7
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
/etc/fstab needs to be updated as this is what fsck uses to check the file systems.
 
Old 06-25-2010, 08:35 AM   #8
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
I would highly recommend utilizing the LABEL= option in fstab matched with the root="LABEL=" option in lilo.conf. Using this will make your setup flexible and portable. This thread will give you a good idea of how to set this up.
 
Old 06-25-2010, 01:14 PM   #9
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Original Poster
Rep: Reputation: 78
Thanks to everyone. Now it works.
Quote:
/etc/fstab needs to be updated as this is what fsck uses to check the file systems.
Yes, this was the problem - when I removed the second driver I didn't update my fstab.
As a perfect solution for this was the use of partition LABELS:
Quote:
I would highly recommend utilizing the LABEL= option in fstab matched with the root="LABEL=" option in lilo.conf. Using this will make your setup flexible and portable. This thread will give you a good idea of how to set this up.
I built an initrd (as in the linked thread was noted) and used LABELS instead of device names. (By the way - do I really need initrd to use LABELS?)
After this when I removed the second drive I was able to boot from DVD. I reinstalled lilo and finally successfully boot with one drive.
 
Old 06-25-2010, 02:35 PM   #10
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
(By the way - do I really need initrd to use LABELS?)
Yes - the initrd includes the init scripts which runs findfs to find which disk volume has the LABEL= set for the root device.

I never noticed this as I have only recently switched to LABEL= in lilo.conf and I always use the generic kernel with an initrd. As an experiment, I tried to boot the huge kernel with a LABEL= and it doesn't work. TSquaredF wisely points this out in the original thread I linked to.

To be honest, reading the lilo.conf man page it looks like this should "just work" but my experience and other mentioned posts show otherwise.

This IBM Linux tip goes into this in some depth.
 
  


Reply



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
I want to copy my hard drive to a larger hard drive and boot from the new drive. lpmorgan1 Ubuntu 8 09-07-2009 11:26 PM
Formated hard drive, runing ubuntu cd cant install, get fedora 11 to boot from hard d IanHarper Linux - Desktop 9 08-10-2009 10:09 PM
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-04-2007 11:28 PM
Installed GRUB on 3rd hard drive, how do I boot 1st drive? jesusphreak Linux - Newbie 4 04-06-2005 09:34 AM
boot from floppy drive then insall linux redhat9 from HARD DRIVE Shiraz Ahmed Linux - Software 0 08-23-2004 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration