LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2004, 10:48 AM   #1
Bill413
LQ Newbie
 
Registered: Nov 2004
Location: Western Massachusetts, USA
Distribution: Red Had 7
Posts: 3

Rep: Reputation: 0
Mounting a Hard Drive


I have a Red Hat Linux box where I have lost the root password. So, I built a boot disk (tomsrtbt), and booted up the machine with that. Now, I need to mount the hard drive so that I can edit the password file. However, I can't seem to find the right syntax.

I have created a directory: /old
I have tried the command:
mount -t nfs /dev/hda /old
I get the error:
mount: directory to mount not in host:dir format.

Please help.
Thanks.
 
Old 11-15-2004, 11:14 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Re: Mounting a Hard Drive

Quote:
Originally posted by Bill413
I have a Red Hat Linux box where I have lost the root password. So, I built a boot disk (tomsrtbt), and booted up the machine with that. Now, I need to mount the hard drive so that I can edit the password file. However, I can't seem to find the right syntax.

I have created a directory: /old
I have tried the command:
mount -t nfs /dev/hda /old
I get the error:
mount: directory to mount not in host:dir format.

Please help.
Thanks.
Why would you be telling a local mount that its NFS, that is for network file sharing.....

And you most likely have to specify the actual partition.. not the whole drive itself..

mount /dev/hda1 /old

Whatever your / directory was mounted on is what you need to mount, probably a good chance it was /dev/hda3 or something like that..
 
Old 11-15-2004, 11:31 AM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Also, editing the password file by hand is probably not a good idea as there is quite likely to be an encrypted backup (is it shadow that does that?). The thing to do is mount the drive, chroot into that system and then change the root password in the usual way.
 
Old 11-15-2004, 11:37 AM   #4
Bill413
LQ Newbie
 
Registered: Nov 2004
Location: Western Massachusetts, USA
Distribution: Red Had 7
Posts: 3

Original Poster
Rep: Reputation: 0
Ok, still no luck. Here's some more information:
Ran:
Code:
fdisk -l
 (omit some info)
                 Boot  Start     End       Blocks         ID     System
/dev/hda1   *           1       13       104391       83     Linux
/dev/hda2              14     763     6024375       83     Linux
/dev/hda3             764    787       192780       82     Linux swap
So, tried:
Code:
mount /dev/hda2 /old
EXT2-fs: ide0(3,2): couldn't mount because of unsupported optional features
mount: wrong fs type, bad option, bad superblock on /dev/hda2, or too many mounted file systems
More info:
Code:
mount
/dev/ram0 on / type minix (rw)
none on /proc tyupe proc (rw)
/dev/ram3 on /tmp type minix (rw)
Also,
mount -t auto /dev/hda2 /old
didn't yield much help either.

Thanks -
 
Old 11-15-2004, 02:57 PM   #5
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
have you tried just booting into single user mode (ie, without the bootdisk)?

http://www.linuxquestions.org/questi...threadid=91098
 
Old 11-15-2004, 04:32 PM   #6
Bill413
LQ Newbie
 
Registered: Nov 2004
Location: Western Massachusetts, USA
Distribution: Red Had 7
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Genesee
have you tried just booting into single user mode (ie, without the bootdisk)?

http://www.linuxquestions.org/questi...threadid=91098
This did it!

Wow - many thanks...I have the box again!

Bill
 
Old 11-15-2004, 05:19 PM   #7
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
glad to hear you got it solved

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help mounting a hard drive cevilgenius Linux - Newbie 15 04-12-2005 02:35 PM
mounting hard drive thug_poet22 Linux - Hardware 14 01-04-2005 02:11 AM
Mounting a Hard Drive Garoth Linux - Software 9 11-11-2004 08:47 PM
mounting a second hard drive evilRhino Linux - General 2 10-17-2002 01:22 AM
Mounting hard drive Runt888 Linux - Newbie 1 08-29-2001 02:02 AM


All times are GMT -5. The time now is 09:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration