# Can i move hdd with FreeBSD to new PC



## Jabali (Nov 12, 2009)

Can i move hdd with FreeBSD to new PC? Or i must reinstall it all?

I am moving hdd from pc with intel e1200 to intel atom 330


----------



## graudeejs (Nov 12, 2009)

I you use GENERIC kernel, there will be no problem moving to other PC, If your new PC hardware is FreeBSD compatible, and both PC's share same architecture

If you have custom kernel, then build GENERIC kernel and then move hdd to new pc


If you have different video card, than you may need to install new driver for X to work


----------



## dennylin93 (Nov 12, 2009)

You might run into problems with /etc/fstab (disks changing numbers). Maybe glabel() might be of some use.


----------



## Jabali (Nov 12, 2009)

Yes i have GENERIC karnel, and i have one HDD (2 slice)... i think g31 video and atome integrated video are diffrent! Thank you i will try too move and than reinstall


----------



## dennylin93 (Nov 14, 2009)

Remember to make backups first.


----------



## Jabali (Nov 14, 2009)

It does not work!!!

I move the HDD and in the boot itis a massage 

Trying too mount root from ufs:/dev/ad0s1a
Manual root filesystem spetification:
...
mountroot>


----------



## Jabali (Nov 14, 2009)

I typed 

mountroot>?

a see disk ad4s1a in list
i typed

mountroot>ufs:ad4s1a

Hau can i mount vi rst partitions?
I can edit /etc/fstab - vi dont work!


----------



## Beastie (Nov 14, 2009)

vi is located in /usr/bin/ and /usr is not currently mounted I suppose.
As dennylin93 said disk numbers have changed, so mount /usr manually using the new location (e.g. ad4s1f) and retry editing /etc/fstab.


----------



## Jabali (Nov 14, 2009)

OK it works i finaly could edit fstab

i did
mount /dev/ad4s1f /usr
mount -u /
ee /etc/fstab
reboot

Question: Is this the only problem after moving HDD too anather PC?


----------



## varda (Nov 14, 2009)

Just edit yout fstab file with new device drive name when hdd running on old PC before moving to new. That's all, it will boot successfully. But if you already have only hdd and don't have old PC...

Everything below is example!

Before to start anything you need to explore your hdd partitioning precisely. After moving to new PC you need to pay attention during boot process at which device appears this hdd. Assume it's really ad4. And hdd partitioning is standard, single slice and so on. Then point boot loader to your hdd root partition

```
mountroot>ufs:ad4s1a
```
After mounting will complete you'll get request for password and shell. Then you need to remount partitions manually with write permissions in order to get access to userland utilities. Process this accordingly your partitioning scheme, below is for example only

```
/sbin/mount -a
```
Ignore error messages.

```
/sbin/mount /dev/ad4s1d /tmp
/sbin/mount /dev/ad4s1e /var
/sbin/mount /dev/ad4s1e /usr
```
Nou you can edit your fstab any convinient to you way.

```
cd /etc
cp fstab fstab-old
/usr/bin/sed -i bak 's/ad0/ad4/g' fstab
/sbin/reboot
```
Explanation. Copy original fstab to fstab-old in order to have possibility to revert if something goes wrong. Replace with sed all occurences of ad0 to ad4 in-place and saves .bak file.

That's all. Should to work now. If all names and partitions observed to real situation.

Check for keys and utilities online or in manual pages.


----------



## varda (Nov 14, 2009)

Jabali said:
			
		

> Question: Is this the only problem after moving HDD too anather PC?



May be you'll need to ifconfig/dhcp new network interface or load module for some specific device. If it not recognized check it with pciconf -lv. Then walk through /usr/share/misc/pci_vendors to identify if it supported or which module to load.


----------

