Solved

Mounting a 2nd hard drive

Posted on 2003-11-07
4
2,191 Views
Last Modified: 2013-12-16
A few months ago, I setup a 2nd hard drive on my RH 9 box.  Last night, I tried replacing that with a new disk (which was NTFS formatted).  It gave me errors on bootup, so I ended up getting rid of the entry and now I'm trying to put the original drive back in place.  Hopefully, I didn't lose my 20 GB of data on the first drive.

When trying to get rid of the entry, I did "rm /dev/hdb1" rather than removing the entry from /etc/fstab.  Now I can't get it back - maybe I deleted all my data?
Here's the error I'm getting now:

[root@drevil /]# mount -t ext3 /dev/hdb1 /data
mount: /dev/hdb1 is not a block device
0
Comment
Question by:mraible
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
arjanh earned 250 total points
ID: 9702158
Hi mraible,

I think you may just only have deleted the device pointer to your partition. Try the following command, and then try again mounting it:
mknod /dev/hdb1 b 3 65

This will recreate the special device pointer in the /dev tree

Cheers,
Arjan
0
 
LVL 1

Author Comment

by:mraible
ID: 9702219
Hmmm, maybe I did delete all my data?  I tried this and here are my results:

[mraible@drevil mraible]$ su
Password:
[root@drevil mraible]# mknod /dev/hdb1 b 3 65
mknod: `/dev/hdb1': File exists
[root@drevil mraible]# rm /dev/hdb1
[root@drevil mraible]# mknod /dev/hdb1 b 3 65
[root@drevil mraible]# cd /data
[root@drevil data]# mount -t ext3 /dev/hdb1 /data
[root@drevil data]# ls
[root@drevil data]# ll
total 0

Here's what I was getting on startup (I haven't tried it with this change):

Checking filesystems
/dev/hdb1:
The superblock could not be read or does not describe a correct ext2 filesystem.                                                                                
If the device is valid and it really contains an ext2 filesystem (and not swap
or ufs or something else), then the superblock is corrupt and you might try running
e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
                                                                               
In /etc/fstab, I have:
                                                                               
/dev/hdb1       /data   ext3    defaults 1 2
                                                                               
If I run 32fsck -b 8193 /dev/hdb1, I get:
                                                                               
e2fsck 1.32 (09-Nov-2002)
e2fsck: Is a directory while trying to open /dev/hdb1


0
 
LVL 1

Author Comment

by:mraible
ID: 9702254
As strange as it may sound - this actually worked!  I don't know what changed, but I switched back to my Windows machine (which has a mapped drive to a directory on this 2nd hard disk, using Samba) and it connected!  And all my files are there!!  You've made my day - thanks arjunh!
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9702393
Glad I could help! I know the feeling when you think you have just deleted all your data :)

Because you first did a 'cd /data' and then mounted something on that place, the ls command was still looking at the old (empty) mount point. If you had done a 'cd ..; cd data' you would have seen the actual mounted data.

Safer (at least for your own mind) is first mounting and then cd'ing to that place:
mount -t ext3 /dev/hdb1 /data
cd /data
ll

Then you would have seen the same thing immediately as what Samba is showing now.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now