Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mounting a 2nd hard drive

Posted on 2003-11-07
4
Medium Priority
?
2,230 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 1000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

783 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