Hi, I tried to transfer some data between two S11 machines via a usb harddrive with zfs on it, but importing the zpool failed (with some assertion error I did not write down) because I did not export it first (on the first machine). I had to go back to the first machine, plug the drive in again and export the fs. Are there some zfs / OS parameters I could set so that my usb drive with zfs on it would meet the expectations one has from a removable drive? (i.e. safe to remove +-anytime) TIA hajma -- This message posted from opensolaris.org
On 26/11/2010 13:16, Pavel Heimlich wrote:> I tried to transfer some data between two S11 machines via a usb harddrive with zfs on it, but importing the zpool failed (with some assertion error I did not write down) because I did not export it first (on the first machine). I had to go back to the first machine, plug the drive in again and export the fs. > > Are there some zfs / OS parameters I could set so that my usb drive with zfs on it would meet the expectations one has from a removable drive? (i.e. safe to remove +-anytime)No you run zpool export first, that is "the OS parameter", this is no different to any other filesystem on any other operating system. If you don''t export it first how is Solaris or ZFS supposed to know the difference between you yanking it out because you are purposely moving it and the drive accidentally falling out or some other error that causes it to be come unavailable. Hint: the answer is you can''t unless you administratively tell ZFS that the pool is supposed to be going away they way you do that is by ''zpool export''. Unlike other filesystems though ZFS will be consistent on disk. You didn''t have to plug it back into to the original system you could have just forced the import. -- Darren J Moffat
On Fri, November 26, 2010 08:16, Pavel Heimlich wrote:> Are there some zfs / OS parameters I could set so that my usb drive with > zfs on it would meet the expectations one has from a removable drive? > (i.e. safe to remove +-anytime)Nope. Most file systems on Unix don''t have the expectation. You may want to look at the following from zpool(1M): zpool import [-o mntopts] [ -o property=value] ... [-d dir | -c cachefile] [-D] [-f] [-R root] [-F [-n]] -a [...] -f Forces import, even if the pool appears to be poten- tially active. [...] http://docs.sun.com/app/docs/doc/816-5166/zpool-1m As it stands, if you try pulling a drive on any Unix system (ext2, ext3, UFS, FFS, XFS, etc.) the system will generally will not respond kindly. Even with Windows and Mac OS X, it''s generally recommended that you "eject" the hardware first in some way. It''s just the other file systems are a little less vocal in their objections when you re-insert the device again. Probably the only file system that doesn''t worry too much about random ejections is FAT(32).
> From: zfs-discuss-bounces at opensolaris.org [mailto:zfs-discuss- > bounces at opensolaris.org] On Behalf Of Pavel Heimlich > > Are there some zfs / OS parameters I could set so that my usb drive withzfs> on it would meet the expectations one has from a removable drive? (i.e.safe> to remove +-anytime)There is no filesystem, in any OS, which is "safe to remove" at any time. Even when a filesystem is idle, let''s take for example, NTFS on a USB thumb drive... The next time it''s connected, the OS knows and recognizes that it was ejected unsafely. But since there wasn''t any corruption caused, it just silently accepts the drive without complaining. I consider that a flaw in Windows. You should always safely eject any media, on any OS, before yanking it out. If you want to configure ZFS to be more "dumb" and "windows like," ... maybe it''s possible somehow, but I doubt it.
> From: zfs-discuss-bounces at opensolaris.org [mailto:zfs-discuss- > bounces at opensolaris.org] On Behalf Of Pavel Heimlich > > I tried to transfer some data between two S11 machines via a usb harddrive > with zfs on it, but importing the zpool failed (with some assertion errorI did> not write down) because I did not export it first (on the first machine).I had> to go back to the first machine, plug the drive in again and export thefs. You should not need to go back to the first machine. If you read the error message more closely, I think you''ll see it says "use -f" or "use -F" to force import.