Accessing data on second drive (freeBSD 4.9)

Posted on 2004-04-21
Last Modified: 2013-12-16
My FreeBSD machine crashed, causing me to reinstall on an extra drive. The old drive is now my slave, of which I'd like to pull some of my old data off of. How can I access my old drive and copy some of my data from it to my new primary drive?

I tried-

mount acd3

And got an error-

"Unknown special file or file system"

I'm not even sure if acd3 is my old drive or not.


Question by:spamuel
  • 4
  • 4

Accepted Solution

fim32 earned 500 total points
ID: 10880239
can you show us your df -k output?

acd3 doesn't look like the name of the hard drive device, it looks like a cd drive.

generally, what you'll have to do is figure out which device it is, then mount it to a filesystem...

like make a directory called oldroot in /mnt, then:
mount /dev/ad1s1a /mnt/oldroot

or something like that, i used a sample device

ls /dev/ad* should show you what devices are available...

Author Comment

ID: 10880838
Just to clarify, I did not have this drive in when I reinstalled FreeBSD. I am using WebMin, which shows the following devices:

Mounted as Type Location In use? Permanent?
Virtual Memory Virtual Memory (swap) /dev/ad2s1b Yes Yes
/ FreeBSD Unix Filesystem (ufs) /dev/ad2s1a Yes Yes
/tmp FreeBSD Unix Filesystem (ufs) /dev/ad2s1f Yes Yes
/usr FreeBSD Unix Filesystem (ufs) /dev/ad2s1g Yes Yes
/var FreeBSD Unix Filesystem (ufs) /dev/ad2s1e Yes Yes
/cdrom ISO9660 CD-ROM (cd9660) /dev/acd0c No Yes
/proc Process Image Filesystem (proc) proc Yes Yes

Listing the directory in dev gave me countless devices, not sure why that is.

Should I return to /stand/sysinstall to somehow manually add my drive?

Expert Comment

ID: 10880895
so the disk wasn't in the system when you reinstalled, but since then you've turned off the system, added the disk, and booted back up?  on bootup, freebsd should have discovered the disk.  if you go into /stand/sysinstall, you should be able to see the partitioning of that disk (you probably don't want to make any changes, esp if you want the old data).

lising /dev/ad* should have given you a lot of devices, but you should be able to see them in groups of /dev/ad2*, which are all the slices of your current root disk, and /dev/adn*, where n is a unique disk.

if you see your old root disk as /dev/ad1*, then you should try mounting one of those slices...
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 10881832
Ok, I had to setup telnet so I could login over my local network, now I can post my df -k stuff..

$ df -k
Filesystem  1K-blocks   Used    Avail Capacity  Mounted on
/dev/ad2s1a    128990  65626    53046    55%    /
/dev/ad2s1f    257998      8   237352     0%    /tmp
/dev/ad2s1g  13690880 813090 11782520     6%    /usr
/dev/ad2s1e    257998  26012   211348    11%    /var
procfs              4      4        0   100%    /proc

>>>so the disk wasn't in the system when you reinstalled, but since then you've turned off the system, added the disk, and booted back up

That is correct.

After trying to mount  ad1s1a, b, c etc..

I got the following error:

"Device not configured"

I also tried mounting ad3s1a and got an error "file system is not clean - run fsck"

I ran fsck, and noticed a few (NO WRITE) remarks.

Here is the other listing you asked for earlier:

$ ls /dev/ad*
/dev/ad0        /dev/ad0s1h     /dev/ad1s1d     /dev/ad2s1      /dev/ad3e
/dev/ad0a       /dev/ad0s2      /dev/ad1s1e     /dev/ad2s1a     /dev/ad3f
/dev/ad0b       /dev/ad0s3      /dev/ad1s1f     /dev/ad2s1b     /dev/ad3g
/dev/ad0c       /dev/ad0s4      /dev/ad1s1g     /dev/ad2s1c     /dev/ad3h
/dev/ad0d       /dev/ad1        /dev/ad1s1h     /dev/ad2s1d     /dev/ad3s1
/dev/ad0e       /dev/ad1a       /dev/ad1s2      /dev/ad2s1e     /dev/ad3s1a
/dev/ad0f       /dev/ad1b       /dev/ad1s3      /dev/ad2s1f     /dev/ad3s1b
/dev/ad0g       /dev/ad1c       /dev/ad1s4      /dev/ad2s1g     /dev/ad3s1c
/dev/ad0h       /dev/ad1d       /dev/ad2        /dev/ad2s1h     /dev/ad3s1d
/dev/ad0s1      /dev/ad1e       /dev/ad2a       /dev/ad2s2      /dev/ad3s1e
/dev/ad0s1a     /dev/ad1f       /dev/ad2b       /dev/ad2s3      /dev/ad3s1f
/dev/ad0s1b     /dev/ad1g       /dev/ad2c       /dev/ad2s4      /dev/ad3s1g
/dev/ad0s1c     /dev/ad1h       /dev/ad2d       /dev/ad3        /dev/ad3s1h
/dev/ad0s1d     /dev/ad1s1      /dev/ad2e       /dev/ad3a       /dev/ad3s2
/dev/ad0s1e     /dev/ad1s1a     /dev/ad2f       /dev/ad3b       /dev/ad3s3
/dev/ad0s1f     /dev/ad1s1b     /dev/ad2g       /dev/ad3c       /dev/ad3s4
/dev/ad0s1g     /dev/ad1s1c     /dev/ad2h       /dev/ad3d

My root password is the same as my old, not sure if that matters though.


Expert Comment

ID: 10882659
out of all you tried, looks like ad3s1a has the strongest possibility?  after you fsck'd, did you try to mount it?

old root password won't make a difference.

Author Comment

ID: 10882969
ok, I ran (after a quick google) fsck -y ad31sa, then mounted the drive and was able to access it, thank you! One last little problem though, my var and usr directories are empty for some reason. I also created a directory in root named www, which seems to have vanished also. Are these seperate somehow? Should I try mounting the others?

Expert Comment

ID: 10884285
well, looking at your new disk layout (and assuming your new disk was made to match), i would guess that your old /usr and /var are in /dev/ad3s1g and /dev/ad3s1e, respectively.

no idea what would have happened to your old /www directory, is it possible (it is probably) that you actually put that directory in /var/www?

i would try mounting /dev/ad3s1g to /mnt/oldroot/usr, and /dev/ad3s1e to /mnt/oldroot/var

you may also need to fsck these partitions before viewing?


Author Comment

ID: 10884467
Yahooo! I found it. I forgot I installed Plesk, which moved all my files.

Thank you!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

808 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