# move /usr fs to other disk



## cx1964 (May 9, 2009)

Because my /usr filesystem was full, I added a new disk to my machine. Then I added this new disk to FreeBSD with a new filesystem on it. I added this file system with mounting point /claude in /etc/fstab. After reboot I could see /claude with df command. Then I copied the content of /usr to /claude with the command

cp -R /usr /claude

After cp finished, I edited /etc/fstab to remove the line with /usr and change mounting point /claude from the new disk to /usr. And at last, a rebooted FreeBSD. Then I got the following messages:

init: can't exec gett '/usr/libexec/getty' for port /dev/ttyv4: now such file or directory.

init: can't exec gett '/usr/libexec/getty' for port /dev/ttyv5: now such file or directory.

etc.

What did I do wrong?
Because I have installed FreeBSD on VMware Server I can rollback the situation before I removed /usr form /etc/fstab.
What are the next steps from this point, to use /usr from my new disk?

Please Help.

Regards

Claude


----------



## vivek (May 9, 2009)

Use cpdup to make correct copy:
cpdup

You also need to label new disk correctly.


----------



## cx1964 (May 9, 2009)

Because of compatability I still use FreeBSD 7.0. cpdup is not available at my system. Do you have a alternative?


----------



## vivek (May 9, 2009)

Yes, try dump command


```
cd /claude 
dump 0af - /usr | restore rf -
```

See http://www.freebsd.org/doc/en/books/faq/disks.html#NEW-HUGE-DISK


----------



## cx1964 (May 9, 2009)

Sorry I gave the wrong information.
I used cp -Rp /usr /claude

instead of cp -R /usr /claude
I thought this was the right way because I read it on one of the posts on this forum.


----------



## vivek (May 9, 2009)

cp is not right tool, you should use dump or tar.


----------



## cx1964 (May 9, 2009)

I executed the commands
cd /claude 
dump 0af - /usr | restore rf -

After a while I got the message filesystem is full.

I will do a rollback again and remove all the data from /claude before I do de dump again.

Can I use only dump oaf on /claude instead of "dump 0af - /usr | restore rf -" ?
A guess "- /usr | restore rf -" stands for a comment?


----------



## graudeejs (May 9, 2009)

oh borther.....

you can't you  have to use

```
cd /claude
dump 0af - /usr | restore rf -
```
2nd line is 2 commands
1st will dump fs to pipe, 2nd will restore fs from pipe to current directory


----------



## vivek (May 9, 2009)

1st command will take you to new partition (mount point).

*dump 0af - /usr* will dump (copy) /usr and all files on fly.
*| restore rf - * will restore input of dump command to current directory /claude using UNIX pipe concept. A pipe feeds input of one or more command to a second command.

Please read man pages and link provided for the details.


----------



## MG (May 9, 2009)

Never used the dump commando. I would do the copy with Midnight Commander, preserving attributes and symlinks.
Then change /etc/fstab to mount the new /usr.
Depending on your system configuration, a drop to single user mode might be needed to change it.


----------



## cx1964 (May 9, 2009)

I rollbacked to previous state, deleted all content from /claude (with rm -R *). Then reexecuted:
cd /claude 
dump 0af - /usr | restore rf -

After the dump completed, edited /etc/fstab.
Delete the line with /usr in /etc/fstab.
Updated the line with /claude, changed /claude for /usr.
Then rebooted. Finally the system started with a new /usr filesystem.

Thanks for your help.
Regards
Claude


----------

