# USB UFS and zfs disk mgt



## ananix (Jan 2, 2012)

Hi guys,

I'm green in FreeBSD but not with UNIX in general, I have just taken over my first installations and am now sitting with a pretty trivial task of freeing a disk array as its data is now consolidated and its storage capacity is needed elsewhere. The remaining data has been decided is going to be copied too, and mounted into the system from a USB harddrive (mirrored).

For some reason it has caused me a lot of headache as the system keeps screwing up the plan.

At one time doing my operations I had the not so nice experience of a *mount -a* rebooted the machine and would not boot. I decided that the machine was not going to play a part of the plan and moved the USB harddrive to the same machine as the disk array its going to replace. This was also the location from where I took a disk copy and it was doing that I decided I wanted to try and move the data to the location where it was actually used, this would save me from some work later on when the last data needed to be migrated or terminated.

When I tried to mount the USB drive on the originating machine I got a permission denied; consulting my logs I realized the system saw the USB harddrive as dirty and mounted at its old mountpoint on the prior machine that rebooted doing *mount -a*. I was forced to do a *fsck* on the disk to make it clean, knowing it was a copy I answered yes to everything it asked just to realize it wiped a catalog but have not freed upits space.

What happened? what should I have done? (not ufs? zfs on usbdrive?) And how do I move along from here with my "lost data"?

I also seem to have problems with using fstab with USB harddrives?

The disk array is maintained with zfs; my plan is to *mkdir* new mountpoint then bring the system to single user mode, start /etc/rc.d/zfs and *zfs set mountpoint* from old mountpoint to new mountpoint. Then mount USB storage to the disk arrays old mountpoint and bring the system back into multi usermode. Does this sound like a plan to you guys that should work? How would you come about the task?

I also wonder what am I doing wrong? I'm fighting with zfs, it only wanting to do online changes?

  I really want to hear some different views on the issues to get some freebsd sparing 

  -- Regards ananix


----------



## wblock@ (Jan 2, 2012)

There are so many questions and variables here that it's very difficult to answer any of them.  It's much easier to deal with one question per thread.

There is also some basic background information missing.  What version of FreeBSD?  Why are you using mount -a instead of just mounting the USB drive?

Also: some USB drives have power management features that can cause them to disconnect after minutes or hours.


----------



## SirDice (Jan 2, 2012)

Also note that USB drives tend to 'move around' if there are other USB drives or memory sticks attached. Instead of the 'regular' /dev/da0s1 etc. you should use labels. Even if the drive numbers move around the labels will stay the same.


----------

