LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-09-2009, 04:14 PM   #1
tur third
Member
 
Registered: Jun 2005
Location: Surrey, UK
Distribution: Ubuntu 10.04, 10.10
Posts: 187

Rep: Reputation: 24
Booting from the wrong hd!


I think I have set up my pc to boot from the wrong hard disk. hdb, and not hda. I found this out when I disconnected hdb, because I think it maybe failing. It freezes on 'Verifying DMI Pool'. I would like to take out the old drive, but didn't really want to re-install Ubuntu on my new one. What do you think I should try?

Thanks

Code:
sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0001476c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        8162    65561233+  83  Linux
/dev/sda2            9448        9729     2265165    5  Extended
/dev/sda3            8163        9447    10321762+  83  Linux
/dev/sda5            9448        9729     2265133+  82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 15.3 GB, 15367790592 bytes
255 heads, 63 sectors/track, 1868 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000696c5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1868    15004678+   b  W95 FAT32

df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sda1                63520     13786     47174  23% /
varrun                     379         1       379   1% /var/run
varlock                    379         0       379   0% /var/lock
udev                       379         1       379   1% /dev
devshm                     379         1       379   1% /dev/shm
lrm                        379        39       340  11% /lib/modules/2.6.24-23-generic/volatile
gvfs-fuse-daemon         63520     13786     47174  23% /home/x/.gvfs
/dev/sdb1                14639     12287      2353  84% /media/disk
/dev/sda3                10001       151      9346   2% /media/disk-1
 
Old 03-09-2009, 04:38 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Go get bootinfoscript from sourceforge - it's a script that'll show us what is what.
 
Old 03-11-2009, 03:47 PM   #3
tur third
Member
 
Registered: Jun 2005
Location: Surrey, UK
Distribution: Ubuntu 10.04, 10.10
Posts: 187

Original Poster
Rep: Reputation: 24
Ok, thanks.

This is the output from the script

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

 => No boot loader is installed in the MBR of /dev/sda
 => Grub0.97 is installed in the MBR of /dev/sdb and looks on boot drive #2 in 
    partition #1 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: _________________________________________________________________________

    File system:       ext3
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 8.04.2
    Boot files/dirs:   /boot/grub/menu.lst /etc/fstab

sda2: _________________________________________________________________________

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

sda5: _________________________________________________________________________

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

sda3: _________________________________________________________________________

    File system:       ext3
    Boot sector type:  -
    Boot sector info:  
    Operating System:  
    Boot files/dirs:   

sdb1: _________________________________________________________________________

    File system:       vfat
    Boot sector type:  Fat32
    Boot sector info:  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/dirs:   

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

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0001476c

Partition  Boot         Start           End          Size  Id System

/dev/sda1                  63   131,122,529   131,122,467  83 Linux
/dev/sda2         151,766,055   156,296,384     4,530,330   5 Extended
/dev/sda5         151,766,118   156,296,384     4,530,267  82 Linux swap / Solaris
/dev/sda3         131,122,530   151,766,054    20,643,525  83 Linux


Drive: sdb ___________________ _____________________________________________________

Disk /dev/sdb: 15.3 GB, 15367790592 bytes
255 heads, 63 sectors/track, 1868 cylinders, total 30015216 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x000696c5

Partition  Boot         Start           End          Size  Id System

/dev/sdb1    *             63    30,009,419    30,009,357   b W95 FAT32


blkid -c /dev/null: ____________________________________________________________

/dev/sda1: UUID="b5d2f0b3-9e53-427a-85e5-5b31236f030a" TYPE="ext3" 
/dev/sda3: UUID="e2406a6d-ccef-4a1f-826e-0d990c3564c5" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sda5: UUID="fd16e8b2-534d-fba1-4244-0896daf3d728" TYPE="swap" 
/dev/sdb1: UUID="4850-2FE4" TYPE="vfat" 

=============================== "mount" output: ===============================

/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-23-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/myname/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=myname)


=========================== sda1/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		3

## 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=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## 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=791 resume=/dev/hda5
# defoptions=quiet splash

## 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 ##

title		Ubuntu 8.04.2, kernel 2.6.24-23-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.24-23-generic root=UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro quiet splash
initrd		/boot/initrd.img-2.6.24-23-generic
quiet

title		Ubuntu 8.04.2, kernel 2.6.24-23-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.24-23-generic root=UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro single
initrd		/boot/initrd.img-2.6.24-23-generic

title		Ubuntu 8.04.2, kernel 2.6.24-22-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.24-22-generic root=UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro quiet splash
initrd		/boot/initrd.img-2.6.24-22-generic
quiet

title		Ubuntu 8.04.2, kernel 2.6.24-22-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.24-22-generic root=UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro single
initrd		/boot/initrd.img-2.6.24-22-generic

title		Ubuntu 8.04.2, kernel 2.6.24-16-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.24-16-generic root=UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro quiet splash
initrd		/boot/initrd.img-2.6.24-16-generic
quiet

title		Ubuntu 8.04.2, kernel 2.6.24-16-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.24-16-generic root=UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a ro single
initrd		/boot/initrd.img-2.6.24-16-generic

title		Ubuntu 8.04.2, memtest86+
root		(hd1,0)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sdb1
UUID=b5d2f0b3-9e53-427a-85e5-5b31236f030a /               ext3    relatime,errors=remount-ro 0       1
# /dev/sdb5
UUID=fd16e8b2-534d-fba1-4244-0896daf3d728 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
/dev/scd1       /media/cdrom1   udf,iso9660 user,noauto,exec,utf8 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
# Added to Mount old vfat IDE drive
#/dev/sdb1	/media/winshare vfat	defaults	0	0

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


  50.4GB: boot/grub/menu.lst
  50.4GB: boot/grub/stage2
  50.3GB: boot/initrd.img-2.6.24-16-generic
  50.4GB: boot/initrd.img-2.6.24-16-generic.bak
  50.3GB: boot/initrd.img-2.6.24-22-generic
  50.3GB: boot/initrd.img-2.6.24-22-generic.bak
  50.4GB: boot/initrd.img-2.6.24-23-generic
  50.4GB: boot/initrd.img-2.6.24-23-generic.bak
  50.4GB: boot/vmlinuz-2.6.24-16-generic
  50.4GB: boot/vmlinuz-2.6.24-22-generic
  50.3GB: boot/vmlinuz-2.6.24-23-generic
  50.4GB: initrd.img
  50.3GB: initrd.img.old
  50.3GB: vmlinuz
  50.4GB: vmlinuz.old
=============================== StdErr Messages: ===============================

umount: /tmp/BootInfo1/sdb1: device is busy
umount: /tmp/BootInfo1/sdb1: device is busy
 
Old 03-11-2009, 06:27 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Do you happen to have an IDE and a S-ATA drive by any chance ???.
The Ubuntu init scripts don't seem to like that mix.

Last edited by syg00; 03-11-2009 at 06:50 PM. Reason: removed previous answer - needed caffeine ...
 
Old 03-12-2009, 03:52 AM   #5
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 52
What if virtually swapping hd1 to hd0?
Grub> map (hd1) (hd0)
Grub> map (hd0) (hd1)
 
Old 03-12-2009, 05:12 AM   #6
tur third
Member
 
Registered: Jun 2005
Location: Surrey, UK
Distribution: Ubuntu 10.04, 10.10
Posts: 187

Original Poster
Rep: Reputation: 24
Yes, I have both IDE and SATA. The SATA drive was to replace a failed IDE drive. I planned to use the other IDE for backups only, and reinstalled Ubuntu with the defaults on what I thought was the SATA drive.
 
Old 03-12-2009, 02:43 PM   #7
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Specify labels instead of UUID. File systems like FAT does not have support for UUID. If you use labels, you can easily boot with any computer and on any controller.
 
Old 03-12-2009, 06:52 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Would you like to explain that Electro ?.
Using either UUID or Label (in the boot parms) requires the use of an initrd that is specifically coded to support such. And the kernel or initrd must have the specific support for the controller and filesystem.
Hardly qualifies as "If you use labels, you can easily boot with any computer and on any controller." - especially for those of us that don't use initrd. For a while, Fedora only supported LABEL (and not UUID) and Ubuntu was the reverse - i.e. you couldn't even use LABEL on Ubuntu (fstab was o.k.)

I haven't tried, but the solution here might be to use /dev/disk/by-id. I have a broken box that needs a total rebuild that has this IDE and S-ATA issue with Ubuntu. I might see if I can get it rebuilt this weekend and try to solve it - in the past I just discarded Ubuntu because it was too hard (used Arch instead).
 
Old 03-13-2009, 04:28 AM   #9
tur third
Member
 
Registered: Jun 2005
Location: Surrey, UK
Distribution: Ubuntu 10.04, 10.10
Posts: 187

Original Poster
Rep: Reputation: 24
I have seen some details on the Ubtuntu web site (although I can't find it now), that suggested the following:

* Use LiveCD version, and Gparted to create a 100mb partition to be used for Boot (presumably at the start of the drive?).
* Then part re-run the install, but choose manual partitioning. In this you then have to define /root, /, /swap and /user (selecting option not to Format the partitions)
* Save this part, then cancel out of the install

You get error messages, but it is supposed to work. Sounds a bit risky, so I have not tried it yet.
 
Old 03-13-2009, 06:15 AM   #10
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Would you like to explain that Electro ?.
Using either UUID or Label (in the boot parms) requires the use of an initrd that is specifically coded to support such. And the kernel or initrd must have the specific support for the controller and filesystem.
Hardly qualifies as "If you use labels, you can easily boot with any computer and on any controller." - especially for those of us that don't use initrd. For a while, Fedora only supported LABEL (and not UUID) and Ubuntu was the reverse - i.e. you couldn't even use LABEL on Ubuntu (fstab was o.k.)

I haven't tried, but the solution here might be to use /dev/disk/by-id. I have a broken box that needs a total rebuild that has this IDE and S-ATA issue with Ubuntu. I might see if I can get it rebuilt this weekend and try to solve it - in the past I just discarded Ubuntu because it was too hard (used Arch instead).
Yes, UUID and/or LABEL have to be supported, but syg00 do not have to be an ass by trying proving me wrong. By now they are supported. Sure Fedora uses LABEL, but I am sure distributions before Fedora could use LABEL. Fedora considered using LABEL for mounting because to ease mounting SCSI and SATA devices.

Yes, have to include every controller in the initrd file to boot with any setup, but that is not the point I am trying to make. The point I am making is using labels is easier because it relates to human words instead of machine description like UUID.

Yes, instead of specifying LABEL=label name can use /dev/disk/by-label/label name.

Not all distributions ask you to specify labels during install, so you have to later set them. The file system administrating utility can be used to set labels after formating or a program like gparted could be used.

One problem using UUID is NTFS and FAT does not support it. Ubuntu developers should have look into this before ever introducing a version of theirs that only uses UUID for booting. Also their patched grub or kernel does not find my IDE drives in the same order that the BIOS sees them. It actually found my drives in the opposite order and the grub config (menu.lst) was related to the wrong arrangement too. I changed the root command in the grub file. If I had to do that, then I can not recommend it to a novice user. I can recommend Sabayon (full version or DVD) to a novice user because it does provide an option to specify a LABEL for each partition and it has reliable installs on IDE and SATA setups.
 
Old 05-02-2009, 03:17 PM   #11
tur third
Member
 
Registered: Jun 2005
Location: Surrey, UK
Distribution: Ubuntu 10.04, 10.10
Posts: 187

Original Poster
Rep: Reputation: 24
Just an update incase it helps:

In the end I decided I needed to ditch the IDE drive, I did the following (may not be the easiest solution but seems to have worked.)

Used LiveCD (GParted)
- Made space at the start of the SATA drive (250mb)
- Created small EXT3 partition to be used as boot in the space created
- Resized main partion (made smaller)
- Created new logical partions (2 big enough for Ubuntu install)
- Intalled Ubuntu into new empty partitions, manually defining partitions, Boot, \ and \usr

Tested, and was able to boot to new install and old install

Used liveCD again, to remove the new logical partitions and resized partition with original install back to previous size.

Edited Menu.lst (in new boot partition) so that only the old installation appears.

I am happy now, as I have not had to overwrite my existing installation and no longer have the IDE drive in use.
 
  


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
Booting from wrong drive zmsc1 Linux - Software 4 02-19-2008 09:19 AM
Booting the wrong boot loader! Oholiab Slackware - Installation 2 01-13-2006 07:25 AM
What am I doing wrong? (Dual Booting) ilovelagar Linux - Newbie 9 07-03-2005 04:30 AM
Wrong kernel: re-booting does not help John Sorkin Linux - General 1 05-05-2005 10:33 PM
booting to the wrong drive bobhasahat Linux - Hardware 4 08-29-2003 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:43 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