Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mounting a 2nd hard drive

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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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

715 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