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
Solved

Mounting a 2nd hard drive

Posted on 2003-11-07
4
2,202 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Install Predefined Certificate on Ubunto 4 48
Remote desktop Ubuntu from Windows 10 5 93
Post Clonezilla image restore issue 6 35
Linux MD5 Hash 7 38
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 …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

860 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