Solved

Mounting a 2nd hard drive

Posted on 2003-11-07
4
2,209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

759 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