Installed Ubuntu 6.10 and GRUB to external- boot error /bin/sh can't access tty

Asked by sgtmattbaker

[My USB external harddrive is set to boot before my internal harddrive in my BIOS]
I disconnected my internal harddrive and then proceeded to install Ubuntu 6.10 and GRUB to my USB 2.0 Maxtor external hard drive (300gb) using the Ubuntu 6.10 LiveCD. I ejected the external drive and went to preferences and chose to not open, mount or do anything when drives are plugged in. I partitioned the external drive into 4 partitions first was 12gb ext3 for ubuntu, 2nd was 270mb for swap partition, 3rd was 15gb for FAT32, 4th partition was the remainder of the drive for NTFS. I want the NTFS to back up my Windows files and media and the FAT32 to be able to share files between Ubuntu and Windows if needed.
     In the install window I set the 12gb ext3 as the / and the 270mb as the swap file, then I hit next and chose GRUB to install to (hd0) because that is the only drive connected to my PC at the that time. Te install was successful. I then rebooted the PC and it loaded GRUB and then went and loaded Ubuntu successfully. After a successful load I shut down, unplugged the external harddrive and rebooted and went into Windows XP Pro. I then plugged in the external hard drive and went to control panel, administrative tools, computer management, and disk management and formatted the FAT32 and the NTFS partition so that they would be usable in Windows (the NTFS that was 250gb took 90 minutes approximately) I then booted the PC down. I rebooted the PC and GRUB loaded and then went to the Ubuntu loading screen. It loaded about this much --- and then went to a black background screen that said this

BusyBox v1.1.3 (Debian 1:1.1.3-2ubuntu3) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
(initramfs)

at this point I could not type anything and powered down. I then loaded the LiveCD again and chose to reinstall ubuntu to the same 12gb partition and set the 270mb as the swap partition. So I reinstalled after the FAT32 and NTFS were formatted and available for use in Windows. I reinstalled and it went successfully. Then I powered down, rebooted and I got the same message at the same place.
    This entire thing was the first time I attempted to Get Ubuntu and GRUB installed on my external hard drive. I did everything the same except after I got the
BusyBox v1.1.3 (Debian 1:1.1.3-2ubuntu3) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
(initramfs)

message the first time I turned off the computer and unplugged the external drive, then plugged it back in then booted again. I got the same screen except it added these 2 lines
sdb assuming drive cache write through
sdb assuming drive cache write through

That message concerned me even more because in Ubuntu sdb means hd1 in GRUB and my second harddrive which is my Windows internal drive is set as the 2nd harddrive in my BIOS. This did not do anything to my Windows partition did it?? I did unplug my internal drive before I installed Ubuntu and GRUB.

Something that might be helpful and important is that my LiveCD is being finicky loading. While booting it will either go to the ubuntu loading screen and load the orange bar all the way, load a little but then the screen will freeze to what looks like 3 different staggered loading bars stacked on top of each other, or it will load a little bit then freeze aand these small squares of the orange Ubuntu desktop will show through the black background like if they were interweaved. All 3 of these screens have the same result though. They all load after a minute max from there and go to the desktop.. though as soon as the desktop loads my monitor goes black like it is off and the light is now orange. If i press ctrl alt and backspace to restart the X server the monitor light will turn green and the desktop will then be visible. Also sometimes it will load in 800x600 resolution while others it loads to what looks like a 1280x1024 resolution (my monitor's native resolution)

I should note that the same ISO I burned this cd I also had on a DVD earlierand used the DVD to install to a partition on my internal drive and everything was working fine for a week. Then I had to reinstall Windows because something bad happened and I decided to try and install to an external drive. All of my hardware is functioning properly in Windows and functioned properly when I had Ubuntu on my internal drive and as much as I know it worked on the external drive before I formatted the FAT32 and NTFS partitions on the external drive.
Here is my hardware list:
ASUS P5B Deluxe/Wi-Fi AP Edition motherboard (Northbridge- Intel P965 Express and Southbridge- Intel ICH8R)
nvidia 7800GT 256mb PCI-eX16
2GB Corsair Dual Channel DDR2 800MHz RAM
Intel Core 2 Duo E6600 (2.4GHz)
Creative Soundblaster Audigy 4 (non-pro) PCI soundcard
LG Super Multi OEM DVD/CD Burner (model GSA-H42N-BK)
NEC ND_2100-AD OEM DVD/CD Burner
floppy drive
media bay (Smartmedia/xD, CompactFlash I/II, MMC/SD, MS/MS PRO, USB 2.0)
Antec TruePower 2.0 550w power supply

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
sgtmattbaker
Solved:
Last query:
Last reply:
Revision history for this message
sgtmattbaker (presbp) said :
#1

The can't access tty error also came up when I moved files into a partition other than the Ubuntu ext3 or the linux-swap. I was in Ubuntu and dragged some files to the FAT32 and then I rebooted went into Windows to retrieve the files and then rebooted to go back to Ubuntu.. got the same error

Revision history for this message
Matt Thompson (mattthompson) said :
#2

I'm not sure my self, but I've posed the question to a few other people and I'm trying to work out the problem as I speak. I should have something soon.

Cheers,

Matt

Revision history for this message
David Morris (dave-greenacre) said :
#3

Hi,

Can you please provide us with the contents of your fstab file (located at /etc/fstab) and your grub conf file (located at /boot/grub/menu.lst)

These can be found by mounting the drive with a live cd and posting them on here. If you need guidance with that then please don't hesitate to ask.

Dave

Revision history for this message
sgtmattbaker (presbp) said :
#4

David Morris wrote:
> Your support request #3346 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+ticket/3346
>
> David Morris requested for more information:
> Hi,
>
> Can you please provide us with the contents of your fstab file (located
> at /etc/fstab) and your grub conf file (located at /boot/grub/menu.lst)
>
> These can be found by mounting the drive with a live cd and posting them
> on here. If you need guidance with that then please don't hesitate to
> ask.
>
> Dave
>
> _______________________________________________________________________
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+ticket/3346
>
>
>
Well I downloaded the CD image for the Ubuntu alternate CD and I have
already partitioned and installed Ubuntu using the text-based
installer. I am going to see if it works correctly if not I will sned
you the fstab. I hope my alternate CD install works though. Thanks for
your help. I will be sure to contact you and share with you how it
worked out!

Revision history for this message
sgtmattbaker (presbp) said :
#5

ok I rebooted and same thing! I think I have narrowed something down now though. I shut down my PC, and opened it up then I disconnected the power and SATA connectors from my internal HDD which is my Windows drive (I don't want anything but Windows on). Now when I boot from the external USB drive and no internal Windows drive connected it boots fine, but when the internal Windows drive is connected I get the error. That sounds to me like it is a GRUB issue, such as GRUB is pointing to the Windows drive somehow and that is why it cannot access tty. Here are the contents of fstab and grub.conf.

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=aac7ae5d-eadf-470d-9e87-d6f1e9dbeaeb / ext3 defaults,errors=remount-ro 0 1
# /dev/sda3
UUID=1753-FA0B /media/windows vfat defaults,utf8,umask=007,gid=46 0 1
# /dev/sda2
UUID=e5c2d717-d081-4bd2-ba5e-b66eaafcab7b none swap sw 0 0
/dev/hdb /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hda /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0

and grub.conf

# 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 change this entry to 'saved' 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=aac7ae5d-eadf-470d-9e87-d6f1e9dbeaeb ro
# kopt_2_6=root=/dev/sda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,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

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

## ## End Default Options ##

title Ubuntu, kernel 2.6.17-10-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot

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

### END DEBIAN AUTOMAGIC KERNELS LIST

I think I might have to edit grub.conf a bit to get it working. Please keep in mind that I do NOT want any modifications to happen to my Windows internal drive. As it sounds to me though GRUB might be pointing to the Windows drive because when I installed Ubuntu on the external drive the Windows drive was not connected.

Revision history for this message
sgtmattbaker (presbp) said :
#6

forgot to add.. thanks for your help.. hope I can get it working.. I am going to start referring people to Ubuntu.

Revision history for this message
David Morris (dave-greenacre) said :
#7

"As it sounds to me though GRUB might be pointing to the Windows drive because when I installed Ubuntu on the external drive the Windows drive was not connected."

That is exactly what is happening.

Now I'm not 100% sure which bits need changing I'm afraid, but making them won't damage anything.

I suspect that since the pc boots to start with you need to just change the references to "/dev/sda" to /"dev/sdb" in both your fstab and menu.lst files (including in the "### BEGIN AUTOMAGIC KERNELS LIST" section as this auto generates this config when you do upgrades)

You may also need to change the "root (hd0,0)" to root(hd1,0) but I'm pretty sure you don't so try the other way 1st.

Revision history for this message
Best sgtmattbaker (presbp) said :
#8

Ok I changed all the stuff in /etc/fstab and /boot/grub/menu.lst that referenced to sda (most of them said sda1) to sdb. I am typing this while Ubuntu is loaded.. and guess what the Windows drive was connected when I was booting.. awesome. Now I have a portable operating system. Thanks for your help.. if I have any problems I will post them again.. but as of right now.. working=awesome

Revision history for this message
David Morris (dave-greenacre) said :
#9

To clarify what happened for people looking at this in the future.

# Ubuntu was installed on the external HDD whilst the windows drive was unplugged.
# This makes ubuntu think its going to be on /dev/sda all the time
# When the windows drive was plugged back in, its order appeared before the external HDD and was assigned /dev/sda, and the external drive became /dev/sdb
# This screws up grub as it was pointing at /dev/sda when it needed to be /dev/sdb

The fstab was correctly solved before (although I didn't notice earlier) by the use of UUID's, however grub was referring to the device directly. I'm not sure if its possible or been worked on by grub needs to be able to make use of UUID's to prevent this happening.

Revision history for this message
sgtmattbaker (presbp) said :
#10

David Morris wrote:
> Your support request #3346 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+ticket/3346
>
> David Morris posted a new comment:
> To clarify what happened for people looking at this in the future.
>
> # Ubuntu was installed on the external HDD whilst the windows drive was unplugged.
> # This makes ubuntu think its going to be on /dev/sda all the time
> # When the windows drive was plugged back in, its order appeared before the external HDD and was assigned /dev/sda, and the external drive became /dev/sdb
> # This screws up grub as it was pointing at /dev/sda when it needed to be /dev/sdb
>
> The fstab was correctly solved before (although I didn't notice earlier)
> by the use of UUID's, however grub was referring to the device directly.
> I'm not sure if its possible or been worked on by grub needs to be able
> to make use of UUID's to prevent this happening.
>

Indeed, that is what was going on, but to clarify when I reconnected the
Windows internal drive the external hard drive was listed as first in
the BIOS, but since Ubuntu sees the internal hard drive as always before
the external ones I simply changed the fstab and grub's menu.lst file to
say sdb instead of sda. Thanks for the help.
>
>

Revision history for this message
Monika Eggers (monikakrug) said :
#11

David Morris wrote:

[[ The fstab was correctly solved before (although I didn't notice earlier) by the use of UUID's, however grub was referring to the device directly. I'm not sure if its possible or been worked on by grub needs to be able to make use of UUID's to prevent this happening. ]]

In grub, one can refer to the partitions by their labels to solve this problem, e.g. root=LABEL=labelofhda2 instead of root=/dev/hda2

The command "blkid" outputs the properties of partitions including their labels.

Revision history for this message
Monika Eggers (monikakrug) said :
#12

I just read something on the Spanish Ubuntu website - appearently it is possible to refer to the UUIDs with grub, too!

http://www.ubuntu-es.org/index.php?q=node/28581
root=UUID=xxxxxxxxx

Revision history for this message
Adam Bogacki (afb-paradise) said :
#13