Unable to format IDE seconday hard-drive with ubuntu on it

Asked by Somshankar Bose

I installed Ubuntu on a new computer and then connected the hard drive of another computer with ubuntu on it to this new computer as a secondary IDE harddrive. I am not unable to format this connected secondary harddrive..can someone help me to format and partition this new drive.

 sudo fdisk -l gives me as below...
I think my secondary device is 20GB hard drive mounted on sdb

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

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 9355 75144006 83 Linux
/dev/sda2 9356 9729 3004155 5 Extended
/dev/sda5 9356 9729 3004123+ 82 Linux swap / Solaris

Disk /dev/sdb: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d9c3c

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2373 19061091 83 Linux
/dev/sdb2 2374 2482 875542+ 5 Extended
/dev/sdb5 2374 2482 875511 82 Linux swap / Solaris
Note: sector size is 2048 (not 512)

Disk /dev/sdc: 1015 MB, 1015021568 bytes
32 heads, 61 sectors/track, 253 cylinders
Units = cylinders of 1952 * 2048 = 3997696 bytes
Disk identifier: 0x6f20736b

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot Start End Blocks Id System
/dev/sdc1 ? 398636 983425 2283019262 72 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(398635, 6, 23)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(983424, 30, 61)
Partition 1 does not end on cylinder boundary.
/dev/sdc2 ? 86419 1078237 3872056480 65 Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(86418, 26, 1)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(1078236, 17, 53)
Partition 2 does not end on cylinder boundary.
/dev/sdc3 ? 957932 1949749 3872056384 79 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(957931, 2, 32)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(1949748, 25, 36)
Partition 3 does not end on cylinder boundary.
/dev/sdc4 ? 1478321 1478349 110998 d Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(1478320, 8, 25)
Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(1478348, 22, 13)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Somshankar Bose
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Connor Imes (ckimes) said :
#1

I'm not sure what is going on with the sdc device, but I don't think that is what you are asking about, so we will leave it alone. In order for format a drive, the partitions must first be unmounted, so make sure this is done. People often suggest using the LiveCD or GParted LiveCD to format partitions, which is necessary only for your root partition, which we are not doing. You can download and install "gparted", then access it from System->Administration->Partition Editor
From here, select the sdb device from the upper right. If you are sure this is the correct one (it won't let you delete the root or other mounted partitions of course), you can delete the existing partitions, thus creating unallocated space. You can then format it however you please. If you plan on keeping this drive in the computer, you will probably want an entry in /etc/fstab for it. We will deal with that later if you want.

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#2

ohh thanks....it worked like a piece of cake....
now what is the next step you talked of!

Revision history for this message
Connor Imes (ckimes) said :
#3

For /etc/fstab? Sure, please post the output of the following commands, then I will tell you exactly what to do with that file. This is assuming you have already formatted and partitioned the sdb drive as you see fit, through gparted.

 sudo fdisk -l
 cat /etc/fstab
 sudo blkid
 mount

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#4

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

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 9355 75144006 83 Linux
/dev/sda2 9356 9729 3004155 5 Extended
/dev/sda5 9356 9729 3004123+ 82 Linux swap / Solaris

Disk /dev/sdb: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d9c3c

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2373 19061091 83 Linux
/dev/sdb2 2450 2482 265072+ 83 Linux
/dev/sdb3 2374 2449 610470 5 Extended

Partition table entries are not in disk order

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#5

the sdb shows as a locked harddrive and I can't copy anything on it..!

Revision history for this message
Connor Imes (ckimes) said :
#6

I see that you did some work on the sdb drive, but I'm curious as to why there are still 2 partitions (+1 logical). I assume you have sdb1 as a normal partition, sdb2 as a logical partition that falls under sdb3 (which is why it says partition table entries are not in disk order).

I suggest backing up what you need from the drive, then delete all existing partitions on the drive (using Partition Editor). At this point you can then format the entire drive with one large ext3 partition which is easier to manage.

After that, please repost the output of those 4 commands I gave earlier and we will create the fstab entry. Otherwise if you want to keep it formatted the way it is, let me know and we will create the correct fstab entries for those.

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#7

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

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 9355 75144006 83 Linux
/dev/sda2 9356 9729 3004155 5 Extended
/dev/sda5 9356 9729 3004123+ 82 Linux swap / Solaris

Disk /dev/sdb: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d9c3c

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2482 19936633+ 83 Linux

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#8

Please open a Terminal from the menu Applications->Accessories->Terminal and type:

mount

copy and paste result here.

thank you

Revision history for this message
Connor Imes (ckimes) said :
#9

OK, we are almost there. We could use /dev/sdb1 in fstab, but I prefer to use UUIDs instead, since these aren't subject to change if the detection order of the disk changes (for most people it's not a problem). However, something worth doing is worth doing right.
I also need to output of
 sudo blkid
From that I will have the UUID and I can provide you with the correct fstab entry based on other information already given. Thanks for sticking with this!

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#10

/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-20-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/tulku/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=tulku)
gvfs-fuse-daemon on /home/user/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user)

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#11

/dev/sda1: UUID="7eb0c1c5-16e9-4c82-954b-95c57e9c4042" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="6453a0b6-f1e8-4f97-8e3a-877ca2794ed0"
/dev/sdb1: UUID="00890644-0f28-4edf-8b31-516a1c011869" SEC_TYPE="ext2" TYPE="ext3"

Revision history for this message
Connor Imes (ckimes) said :
#12

Cool, first open fstab for editing
 gksudo gedit /etc/fstab
If there are any pre-existing entries for the sdb drive, comment them out by placing a # at the front of the line
I will call the mount point "disk2" - you can call it whatever you want, just change where appropriate and please don't use names with spaces. Now add this line to the bottom:
 UUID=00890644-0f28-4edf-8b31-516a1c011869 /media/disk2 ext3 defaults 0 2
Save and cloes fstab. Now create the mount point:
 sudo mkdir /media/disk2
Now mount the drive (actually, mount everything in fstab):
 sudo mount -a

If you get any bad feedback, post it here. If you want us to check your fstab entry, please post back the contents of the entire file. Otherwise, you should be good to go now!

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#13

i did as you said and I got an error..so I am posting all info

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=7eb0c1c5-16e9-4c82-954b-95c57e9c4042 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=6453a0b6-f1e8-4f97-8e3a-877ca2794ed0 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
UUID=00890644-0f28-4edf-8b31-516a1c011869 /media/disk2 ext3 defaults 0 2

from terminal window

tulku@user-desktop:~$ gksudo gedit /etc/fstab
tulku@user-desktop:~$ sudo mkdir /media/disk2
tulku@user-desktop:~$ sudo mount -a
mount: special device /dev/disk/by-uuid/00890644-0f28-4edf-8b31-516a1c011869 does not exist
tulku@user-desktop:~$ gksudo gedit /etc/fstab

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#14

i did as you said and I got an error..so I am posting all info

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=7eb0c1c5-16e9-4c82-954b-95c57e9c4042 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=6453a0b6-f1e8-4f97-8e3a-877ca2794ed0 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
UUID=00890644-0f28-4edf-8b31-516a1c011869 /media/disk2 ext3 defaults 0 2

from terminal window

tulku@user-desktop:~$ gksudo gedit /etc/fstab
tulku@user-desktop:~$ sudo mkdir /media/disk2
tulku@user-desktop:~$ sudo mount -a
mount: special device /dev/disk/by-uuid/00890644-0f28-4edf-8b31-516a1c011869 does not exist
tulku@user-desktop:~$ gksudo gedit /etc/fstab

Revision history for this message
Connor Imes (ckimes) said :
#15

Did you fiddle with the partition more? Check the output of
 sudo blkid
again to get the correct UUID if you changed something. Otherwse, try replacing
 UUID=00890644-0f28-4edf-8b31-516a1c011869
with simply
 /dev/sdb1
then try to mount again.

Revision history for this message
Somshankar Bose (tulku76-gmail) said :
#16

it worked this time..when i tried by replacing with /dev/sdb1
no i did not fiddle...i dunno what was the problem...