Recovering root password from a drive by mounting the cdrom

Mukarram Syed muksyed at
Mon Jul 7 03:45:25 UTC 2008

Thanks for this response and others.
However, my problem does not look to be so simple.

I boot off the install cd and get into the fixit prompt.

I dmesg | less and get the device name that I think is my hard drive /dev/ad0.
I fdisk /dev/ad0 and get information about 3 slices.  I am think /dev/ad0 slice 3 is the root file system because slice 3 has a greatest amount of disk space and that looks like my root partition
Then I ls -l /dev |grep ad0 and it spits out a number for /dev/ad0 like ad0s0 ad0s1 ad0s3 etc.
I am assuming /dev/ad0s3 is slice 3 which I believe it to be my root partition.
So I mount it:
mount /dev/ad0s3 /mnt
I do a df -k and find that /mnt has 0 bytes available.  To check I cd /mnt and ls and don't find any data in it.
I check/dev/ad0s2 /dev/ad0s1 in the same way.  None of it has any data.

I guess there is something else that I am missing at this point.

Can anyone advise.


# mukarram

 Mukarram Syed
muksyed at

----- Original Message ----
From: Wojciech Puchar <wojtek at>
To: Mukarram Syed <muksyed at>
Cc: freebsd-questions at
Sent: Sunday, July 6, 2008 2:18:56 PM
Subject: Re: Recovering root password from a drive by mounting the cdrom

> I need your help!
> I have booted up from a freebsd install cd 1.  I have connected my freebsd drive in the system.  Now I don't know how to mount the drive to edit the /etc/shadow file.
> I am at the fixit prompt on the cd.


mount <yourrootpartition> /mnt
mount <your_usr_partition_if_separate> /mnt/usr

cd /mnt
chroot . usr/bin/passwd

and change the password
freebsd-questions at mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"


More information about the freebsd-questions mailing list