Weird Linux Question - Where's My Second Hard Drive?

I am finally back online after losing everything… and I was given a free computer. It is a pentium 2 and I figured the best way to keep it running was to put a Linux derivative on it, so I chose Xubuntu 10.10, and its running great except for the fact that it loaded itself on the slave hard drive instead of the larger original one. And now I can’t see it. I went through the tutorial on how to mount the other one at the command prompt but it just gives me a general failure on the command.

Any ideas from the TM?

If it matters:

Pentium 2 @ 350MHz
384 MB SDRAM
Master IDE: 9.2 GB (woo hoo)
Slave IDE: 6.0 GB (the one that is currently the “file system”

Thanks.

What command are you using and what is the error message?

Use gparted to see if the other drive is accessible and formatted. Gparted can format it to a Linux file system (probably want ext4).

Just type “gparted” at the command prompt and it will tell you how to install it if it’s not already installed.

In modern linuxes, all hard drives are generally located at /dev/sd?, where ? is a letter based on the order the drives are recognized. Usually, the primary hard drive is /dev/sda and the secondary one is /dev/sdb, however, since you are booting from the secondary hard drive, those might be reversed.

I second the idea that you need to call up gparted, which will have a drop down list of all your hard drives. And, likely, you’ll need to put a partition and filesystem on the other drive. The gparted interface is pretty self explanatory, but, if you need help, don’t hesitate to ask.

You could also try mount and df, so you can see what filesystems are configured and available (in a text console).

Post the output of these commands, and we can advise you from there.

Si

Unless something has changed (or it varies by distro), IDE drives like the OP’s are located at /dev/hd?.

Note also that reference to a drive’s partitions include numbers also (e.g., /dev/hda1, /dev/sdb4, etc.).

Digital Stimulus is right, IDE drives will be /dev/hd??, not sd. df will only show mounted filesystems, you want to be posting the output of the command:

sudo fdisk -l

Might be a good idea to post the contents of /etc/fstab too,

I can’t install gparted, this is what I get:

danny@danny-desktop:~/Desktop$ gparted
The program ‘gparted’ is currently not installed. You can install it by typing:
sudo apt-get install gparted
danny@danny-desktop:~/Desktop$ sudo apt-get install gparted
[sudo] password for danny:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

GF doesn’t do anything, but MOUNT does this:

mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/danny/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=danny)
danny@danny-desktop:~/Desktop$

I don’t know what any of that means… I know DOS pretty well and those commands are fairly intuitive to me, but the linux command prompt structure doesn’t really make much sense to me.

sudo fdisk -l

Disk /dev/sdb: 6448 MB, 6448619520 bytes
255 heads, 63 sectors/track, 784 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d68b6

Device Boot Start End Blocks Id System
/dev/sdb1 1 744 5970944 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 744 784 323585 5 Extended
Partition 2 does not end on cylinder boundary.
/dev/sdb5 744 784 323584 82 Linux swap / Solaris

Disk /dev/sda: 10.3 GB, 10262568960 bytes
255 heads, 63 sectors/track, 1247 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dc8df

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1189 9544704 83 Linux
/dev/sda2 1189 1248 475137 5 Extended
/dev/sda5 1189 1248 475136 82 Linux swap / Solaris

… and I don’t know what the hell any of that means. :confused:

What do you get when you type this:

cat /etc/fstab

and which drive do you want linux on? It is currently on /dev/sda which is 10.3 GB.
The other drive is /dev/sdb which is 6448 MB. It’s on the larger drive already.

This means that something else like synaptic or the software center is locking the ability to install things. I had some trouble with that hanging even though the app wasnt active. It was trying to install a circular reference and it couldnt. A fresh boot took the lock off.

Ok, from the output you have posted,

You have /dev/sda, a 10.3Gb disk.

This has a 9.5Gb Linux partition /dev/sda1

which has the mount point / and is type ext4.

There is also a swap partition /dev/sda5 in an extended partition container /dev/sda2 of 475Mb.

You also have /dev/sdb, a 6.4Gb drive

which is not mounted, but has a 5.9Gb linux partition and a swap partition in an extended partition container (not organised very well, as the partitions are not aligned to the cylinders).

To use this disk, you need to mount it on to your existing filesystem. The main linux filesystem divisions are /boot, /home, /usr, /var. 6Gb is fairly large, so my suggestion would be to use the second disk for something like /home (all the user files). Others may make different suggestions.

The following should be carried out in the recovery console boot or in a single console session to prevent locked files (after boot, before logging in with gdm/kdm use ctrl-alt-F1 to switch to the console, log in as a user).

use mkdir to create /mnt/newhome


**sudo mkdir /mnt/newhome**

mount the second disk


**sudo mount /dev/sdb1 /mnt/newhome**

If you get a mount error it will almost certainly be because the partition has not been formatted as ext4. Use mkfs.ext4 to do this


**sudo mkfs.ext4 -j /dev/sdb1**

and retry the mount command above.
run a mount command to verify the mount


**sudo mount**

You should now see a reference to /dev/sdb1 in the list of mounted volumes.
You can cd to /mnt/newhome to check the new volume


**cd /mnt/newhome
ls -l**

If the directory is not empty, delete files


**sudo rm -Rf /mnt/newhome/***

cd back to /


**cd /**

Copy the files from /home to /mnt/newhome


**sudo cp -R -p /home /mnt/newhome**

Once this is completed, rename /home to /oldhome.


**sudo mv /home /oldhome**

create a new empty home directory


**sudo mkdir /home**

unmount /dev/sdb1


**sudo umount /dev/sdb1** 

check permissions on /home


**ls -l /oldhome**

set /home to have the same permissions using chmod/chown
mount /home


**sudo mount /dev/sdb1 /home**

use ctrl-alt-F7 to switch back to a gui console
log in to ensure that /home is working.
In a terminal window type


**sudo gedit /etc/fstab**

copy the /dev/sda1 line to a line just below it, and edit /dev/sda1 to /dev/sdb1, and change / to /home (leave all other options the same). Save the file.
log out of the gui and switch back to the text console ctrl-alt-F1
unmount home


**sudo umount /dev/sdb1**

confirm with mount
mount /home using fstab


**sudo mount /home**

confirm mount
reboot


**sudo shutdown -r now**

at the login screen, ctrl-alt-F1 and login
check that the mount has occurred correctly


**sudo mount**

and that files are on /home


**cd /home
ls**

ctrl-d to log out, ctrl-alt-F7 to go back to gui
log in

at some point when you are confident that everything is working you can delete /oldhome.
To back out this change,


**sudo umount /home
sudo rm -R /home
sudo mv /oldhome /home**

and remove the /dev/sdb1 line from /etc/fstab.

Si

Not since Linux 2.6.19. IDE was consolidated with the rest of the hard drives, which had already been consolidated with SCSI under /dev/sd?. Even my USB flash drive is under /dev/sdc1.

What happened is that the old IDE drivers were so full of obscure bugs that, rather than fix them, the entire framework was rebuilt on libdata. While both the old and new drivers existed for a while, I’ve yet to see them on a modern system. I cannot find any information about whether they’ve been officially deleted, but I know they aren’t available on Slackware-based or Debian-based Linuxes.

Huh, so something has changed. Tremendous, thanks for that information.

Off-topic: so, can you tell me why my Debian (testing) system now (well, for months now) locates my DVD-RW at /dev/sr0? I could delve myself, but if you know off the top of your head, it’s easier to just ask… :slight_smile:

http://www.linuxdocs.org/HOWTOs/SCSI-2.4-HOWTO/sr.html

sr is the device driver.
0 is the 1st device.

First make sure you don’t have any application running that does software installs or updates. If you don’t, you can safely remove the lock file and then the install will work. To remove the file:

sudo rm /var/lib/dpkg/lock

If you’re unsure if you have any update/install app running, logout and back in. Any app like that will exit at logout.

I have a computer with Slackware 13.0, 2.6.29 kernel, and still have /dev/hd*. It was the last version to have IDE drivers in the kernels. 13.1 came with 2.6.33 kernels, so it must have been yanked between .29 and .33 somewhere.

Thanks! I assume that, although the (informative) linked doc is for 2.4 kernels, it carries through to 2.6…

Based on what I’m reading there, I think this is the first non-ATAPI drive I’ve owned, recently purchased to replace a failed ATAPI drive. Hence, the change in device location, and resultant confusion in some multimedia software (like VLC). It’s good to have some explanation, even if I don’t have all the details exactly correct.

Sorry for the hijack, OP.