On Linux and mounting hard drives
Posted: 2010-10-13 09:19am
So, stupidly, I upgraded my Ubuntu 10.04 box to 10.10 and it broke hardcore. Fortunately, I have two 320 GB hard drives in my Linux box, and one of has been sitting idle for the last couple years. In a flash of genius, I decided I would do the following:
1. Install a fresh copy of 10.04 on the spare hard drive, hereafter referred to as /dev/sdb
2. Copy /home directories, samba config files, etc. from the busted 10.10 installation, which resides on /dev/sda
3. Never upgrade Ubuntu again.
So, I run the installation, everything goes fine. So as not to accidentally overwrite my data, I physically disconnect /dev/sda while in install to /dev/sdb. I reconnect the drive after I've successfully booted into the new 10.04 install.
Now, in the past, the spare 320 GB drive would be automagically mounted so that I could look at it. This time, however, /dev/sda wasn't anywhere to be found. When I checked in Ubuntu's Disk Utility, I saw it there. "Ok," I thought, "I'll just click on the button that says 'mount drive,' and...hey, what the hell is the error?"
The error I'm getting is that /dev/sda1 is already mounted to / . This, of course, cannot be, because because the Disk Utility says that /dev/sdb1 is mounted to /. So, I examine the contents of /etc/fstab. In there, it lists /dev/sda1 as already being mounted to /. Curiouser and curiouser.
Basically, something is lying to me. Either the Disk Utility is fucking with me, and /dev/sdb is really /dev/sda, or the system is ignoring /etc/fstab when it's booting and mounting the disks. The question then becomes:
Can I change /etc/fstab safely? In other words, can I ignore the fact that that the Disk Utility is telling me that /dev/sda1 is already mounted to /, when it's abundantly clear that /dev/sdb1 is mounted there? Can I simply mount /dev/sda1 to another location, ignoring this apparent confusion? Further, would changing /etc/fstab to jive with what the Disk Utility is telling me be a bad idea?
1. Install a fresh copy of 10.04 on the spare hard drive, hereafter referred to as /dev/sdb
2. Copy /home directories, samba config files, etc. from the busted 10.10 installation, which resides on /dev/sda
3. Never upgrade Ubuntu again.
So, I run the installation, everything goes fine. So as not to accidentally overwrite my data, I physically disconnect /dev/sda while in install to /dev/sdb. I reconnect the drive after I've successfully booted into the new 10.04 install.
Now, in the past, the spare 320 GB drive would be automagically mounted so that I could look at it. This time, however, /dev/sda wasn't anywhere to be found. When I checked in Ubuntu's Disk Utility, I saw it there. "Ok," I thought, "I'll just click on the button that says 'mount drive,' and...hey, what the hell is the error?"
The error I'm getting is that /dev/sda1 is already mounted to / . This, of course, cannot be, because because the Disk Utility says that /dev/sdb1 is mounted to /. So, I examine the contents of /etc/fstab. In there, it lists /dev/sda1 as already being mounted to /. Curiouser and curiouser.
Basically, something is lying to me. Either the Disk Utility is fucking with me, and /dev/sdb is really /dev/sda, or the system is ignoring /etc/fstab when it's booting and mounting the disks. The question then becomes:
Can I change /etc/fstab safely? In other words, can I ignore the fact that that the Disk Utility is telling me that /dev/sda1 is already mounted to /, when it's abundantly clear that /dev/sdb1 is mounted there? Can I simply mount /dev/sda1 to another location, ignoring this apparent confusion? Further, would changing /etc/fstab to jive with what the Disk Utility is telling me be a bad idea?