Tech Support Guy banner

Second hard drive issue

2614 Views 35 Replies 2 Participants Last post by  saikee
Now working on a second computer which already has Ubuntu 6.06 installed. Have partitioned and formatted a second (larger) hard drive with partitions:

Device Boot Start End Blocks Id System
/dev/hdb1 1 1217 9775521 83 Linux
/dev/hdb2 1218 1340 987997+ 82 Linux swap / Solaris
/dev/hdb3 1341 18362 136729215 83 Linux
/dev/hdb4 18363 19929 12586927+ 83 Linux
1 is boot, 3 is for /home, and 4 will be changed to fat32. 6.06 is installed

and have booted the original drive which has the following partition structure:

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3570 28675993+ 7 HPFS/NTFS
/dev/hda2 3571 4711 9165082+ 83 Linux
/dev/hda3 4712 4998 2305327+ 82 Linux swap / Solaris
The NTFS partition is corrupted, so this drive needs repartitioning and reinstalling.

After the reboot, I first tried to use the File Browser with the idea that I would simply copy the home directory from hda2 to hdb3, repart/reinstall hda with a structure more like hdb, copy /home back to the hda /home partition. However when I click on any partition, the Browser gives the message

Unable to mount the selected volume
with details as:

error: device /dev/hda[2-3] (or hdb[1-4])* is not removable
error: could not execute pmount
*(the "hda[2-3] (or hdb[1-4])" is my way of indicating that this is true for both drives and all linux partitions, although it will show the filesystem and home directories in hda2)

Here is fstab:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1
/dev/hda3 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
This newbie has suddenly jumped in over his head. I imagine that I need to figure out how to mount the hdb drive, but why is it giving the same message for hda?

Or am I not seeing a larger problem? Any guidance will be appreciated.
Status
Not open for further replies.
21 - 36 of 36 Posts
geometry:

hda:
Partition number: 2 Filesystem type is fat, partition type 0xc
Partition number: 4 Filesystem type is fat, partition type 0xb
Partition number: 5 Filesystem type is ext2fs, partition type 0x83

and
hdb:
Partition number: 0 Filesystem type is ext2fs, partition type 0x83
Partition number: 1 Filesystem type is unknown, partition type 0x82
Partition number: 2 Filesystem type is ext2fs, partition type 0x83
Partition number: 3 Filesystem type is unknown, partition type 0x83
booting from hda

Partition hdb1 is / on this drive

Not sure how to get fstab from hdb without reconnecting drives and booting from hdb, If I can get there via the shell, will need your guidance. Or can disconnect and boot from hdb as you suggest.

(For what it might be worth, my post yesterday at 11:32 has output from this drive for dmesg and menu.lst. Don't know if any info in these will give you what you might otherwise seek from the fstab? Please keep in mind that in that post it shows as hda since I booted from it, but it is now hdb since it booted from the old drive)
I shall assume that you are booting from hda. That means you have access to the Linux in hda6.

Your Grub output confirms hda is the 1st disk (hd0), as Grub counts from 0. Your hda6 is shown up there as the partition 5.

I don't know why you say "partition hdb1 is / on this drive" as your fstab does not indicate any of the partition from hdb would be mounted.

To get the second /etc/fstab you need to mount the partition first by commands
Code:
mkdir /mnt/hdb1
mkdir /mnt/hdb3
mount /dev/hdb1 /mnt/hdb1
mount /dev/hdb3 /mnt/hdb3
find / -name fstab
The above should return two location of /etc/fstab. Post the missing one here.

Also post the /mnt/hdb1/boot/grub/menu.lst and the /boot/grub/menu.lst of the boot up Linux in hda6.

I shall need you boot the second system
See less See more
from my previous post:

booting from hda
I don't know why you say "partition hdb1 is / on this drive" as your fstab does not indicate any of the partition from hdb would be mounted.
I was just giving information. When I formatted this drive (which we are now seeing as hdb), I set the first partition as "/", the second as /swap and the third as /home.

The "missing" fstab is at:

/mnt/hdb1/etc/fstab

Here is fstab from that location:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/hda1
UUID=f8456a64-1ceb-4a82-9631-fd825e7c5d86 / ext3 defaults,errors=remount-ro 0 1
# /dev/hda3
UUID=5f298ac6-32e7-4d4f-8bf5-a87c81af39b0 /home ext3 defaults 0 2
# /dev/hda4
UUID=45AA-D8FB /media/hda4 vfat defaults,utf8,umask=007,gid=46 0 1
# /dev/hda2
UUID=e781d5c4-d2a9-4b57-84de-915a7ed0ee17 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hdc /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0
Here is /mnt/hdb1/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 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=f8456a64-1ceb-4a82-9631-fd825e7c5d86 ro
# kopt_2_6=root=/dev/hda1 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/hda1 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/hda1 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
and /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'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## 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 optons 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 specifiv 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=root=/dev/hda6 ro

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

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

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

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

## ## End Default Options ##

title Ubuntu, kernel 2.6.10-6-386
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-6-386 root=/dev/hda6 ro quiet splash
initrd /boot/initrd.img-2.6.10-6-386
savedefault
boot

title Ubuntu, kernel 2.6.10-6-386 (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-6-386 root=/dev/hda6 ro single
initrd /boot/initrd.img-2.6.10-6-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda6 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda6 ro single
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel memtest86+
root (hd0,5)
kernel /boot/memtest86+.bin
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda3
title Microsoft Windows XP Professional
root (hd0,2)
savedefault
makeactive
chainloader +1
I stopped back at the office en route to a business meeting to post this and will stop again on the way back to reboot the second system and answer questions/post results as you might need. I can delete the remarks to shorten the posts if you do not need them-pls advise.

Many thanks.
See less See more
When I boot from the second system, what info can I obtain that will be helpful?
I don't know how the new UUID system works in Ubuntu and would rather re-write its fstab. However before we do that can you try to boot it manually as follow using the existing fstab (possibly causing a panic)

When you see a Grub boot screen press "c" will drop you to a Grub prompt. These lines should fire up the Ubuntu in hdb
Code:
root (hd[color=red]1[/color],0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hd[color=red]b[/color]1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
boot
Sounds exciting indeed! In the event that I encounter a situation that appears to be a panic, what is the recovery procedure please?
OK can you mount /dev/hdb1 on /mnt/hdb1 and edit /etc/fstab using possibly
Code:
sudo mount /dev/hdb1 /mnt/hdb1
sudo gedit /mnt/hdb1/etc/fstab
and implement the following changes in /mnt/hdb1/etc/fstab
proc /proc proc defaults 0 0

/dev/hdb1 / ext3 defaults,errors=remount-ro 0 1

/dev/hdb3 /home ext3 defaults 0 2

/devhdb4 /media/hda4 vfat defaults,utf8,umask=007,gid=46 0 1

/dev/hdb2 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hdc /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0
The red bits are the actual alterations required.

The above should stop it from a panic.

If things work out the lines you manually boot up the Ubuntu in hdb are the commands needed to be put inside the /boot/grub/menu.lst of hda6 (in hda), except you need an identifcation with the "title" statement at the beginning like
Code:
title My other Ubuntu in hdb1
. You can add the lines now to save typing them in every time. Grub wouldn't mind to boot it for you.
As I begin to implement your guidance, I see some questions:

The red bits are the actual alterations required.
In the post above, the red bits show only as

/dev/hdb1 /
in the entire line of:
/dev/hdb1 / ext3 defaults,errors=remount-ro 0 1
Since the second part of that line does not appear in the existing file text, I expect that the entire line should be added, and the same is true of all four lines that begin with red text. Please confirm.

The current text in the fstab file is:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/hda1
UUID=f8456a64-1ceb-4a82-9631-fd825e7c5d86 / ext3 defaults,errors=remount-ro 0 1
# /dev/hda3
UUID=5f298ac6-32e7-4d4f-8bf5-a87c81af39b0 /home ext3 defaults 0 2
# /dev/hda4
UUID=45AA-D8FB /media/hda4 vfat defaults,utf8,umask=007,gid=46 0 1
# /dev/hda2
UUID=e781d5c4-d2a9-4b57-84de-915a7ed0ee17 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hdc /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0
So my question is, assuming that I should add the lines:
/dev/hdb1 / ext3 defaults,errors=remount-ro 0 1

/dev/hdb3 /home ext3 defaults 0 2

/devhdb4 /media/hda4 vfat defaults,utf8,umask=007,gid=46 0 1

/dev/hdb2 none swap sw 0 0
in their entirety, does it matter whether they are added at the end of the file or do they need to go above the line?:
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
Secondly, by:
manually boot up the Ubuntu in hdb
do you mean that I should shut down and manually change the cable config, or that I should use the manual technique of entering "C" while grub is showing, as you instructed above?

Finally,
If things work out the lines you manually boot up the Ubuntu in hdb are the commands needed to be put inside the /boot/grub/menu.lst of hda6 (in hda),
My understanding is that these lines be should be added (and if placement is important, please advise where, as above) to the existing text rather than modifying any existing lines. If this is incorrect, please advise.

Thank you for your patient guidance on this. I can see light at the end of the tunnel and this certainly is the learning experience you predicted.
See less See more
I colored the red bits to assist you to do less typing. The black bits are from your original fstab untouched by me. Basically I delete the UUID references and replace them with the device names. UUID is new and haven't been used in many Linux but the device names can be found by all Linux kernels.

You need the full line in each case. If I were you I copy and paste the whole lot over the existing file.

I have requested that you should never unplug the hard disk connections from now on. If you do the disk order can be messed up again. Therefore to boot the system manually you boot up sda6 Linux's Grub screen and press "c" to get a Grub prompt. You then type line by line as shown in Post #25 to boot the Ubuntu in sdb1 manually.

I like you getting the hands dirty by manually boot up a Linux and your Post #26 suggests you have done that. Did you cheat? Believe me it gives us a kick in the feeling if you manage to boot up a system manually. You are then grabbing Grub by its horns and has this bugger serve you as a slave forever.

OK here is the menu.lst you should have (just copy and paste the whole lot) in the sda6's /boot/grub/menu.lst (I delete the lines with # as those are not acted on)
Code:
default 0
timeout 10
title Ubuntu, kernel 2.6.10-6-386 
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-6-386 root=/dev/hda6 ro quiet splash
initrd /boot/initrd.img-2.6.10-6-386
savedefault
boot

title Ubuntu, kernel 2.6.10-6-386 (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-6-386 root=/dev/hda6 ro single
initrd /boot/initrd.img-2.6.10-6-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386 
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda6 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda6 ro single
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel memtest86+ 
root (hd0,5)
kernel /boot/memtest86+.bin 
savedefault
boot

[color=red]title My other Ubuntu in sdb1
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
boot[/color]
Again I have colored the bits red that you would have to add.
See less See more
All the changes made, I hope!

Now rebooting with fingers crossed.

Be back shortly. :D
Woo Hoo! It worked!

When I restarted and the grub loader came up, I noticed that my line for the hdb disk came up (It is "Ubuntu 6.10"), I just clicked on it and up it came.

I was expecting to enter "C" during grub and add those lines, but it wasn't necessary. So I went back and re-read the last few of your posts and realized that the "C" process was what you meant by manually booting from hdb? Also now understand the question about cheating, which I now realize that I did.

Now also realize that you thought by my quoting you with "a panic" that you thought I had actually encountered one. However, no I had not, but was just trying to get ready for it if it happened.

Sooooo, I went back and restarted, following your instructions and up it came up again. (Even copied down the print response to each line so that I can prove that I did it.) Hot damn!

I do realize that without your help, I would have needed a month of Sundays to figure any of this out. So hopefully some of it will stick!

I do have a new question now which I will put up here as it would take too long to start a new thread and give enough background to be understood. When one is dual booting, as in this case, and I want to use Nautilus to view a file on the other hdd, how do I do it? I reckon that the other drive must be mounted manually now?

Once that is done, will the other drive show up in Nautilus or will the system just put an icon on the desktop?

Apologies for this very basic question, but my poor head is spinning from all this and I may need a real ale before it is going to clear up.

Thanks again.
See less See more
You have learned how to mount a partition manually now. Once it is mounted you will see it in Nautilus. It is the same if you boot to the other Linux.

It is exactly the same thing if you hook any USB device.

To mount it automatically you add an entry to fstab.

Enjoy Linux.
Thank you most sincerely.
No need to thank me.

I am just passing the information other members of the forum had taught me.

Linux itself is very logical. If you are not in a hurry you can reason some of the bits out yourself after using it for a while.

It is an unselfish and public system that we can all share knowledge together.
I understand your point, but it was your time that was unselfishly given and I am indeed sincerely grateful.

Another thing that I am learning is how important it is to understand the file system. I had originally planned to learn as I go, and I am, but I think it is now time to go back and systematically study the file system.

Best regards.
I have been installing quite a few of OS especially Linux and many things are obvious to me so I offer suggestions to others like yourself to get the system up and running. In giving out instructions it helps me to consolidate my understanding of the subject too, as I have to be certain the advice will hit the mark.

I can't get everything right. If I make a mistake hopefully other more experienced Linux users can step in and so I can learn from my mistakes as well.

It does give me a kick in getting my predictions right in your case.

I thank you for a good response. Many got the problem sorted, walked away and wouldn't let me know if the advice any good to them. That makes me nervous giving out advice to the next one.

I enjoy Linux and derive pleasure in seeing others enjoying it too. You are pretty quick too in picking up the ideas. Many have to be taken by the hand.

In future if you think we can be of help just post your threads here.
21 - 36 of 36 Posts
Status
Not open for further replies.
Top