Thanks for the clarification, Darren, and sorry for cross-posting.
OK, physical device -> pool -> file-system(s)
Some questions:
1) zpool import allows options similar to zfs. Can I set the same or similar
read-only (RO) options for the whole pool
(noexec,nosuid,noatime,nodevices,ro)?
2) What changes are made to a pool's data by exporting/importing it?
My guess is that something gets written to the zpool.cache but also to the
pool's vdev labels themselves... but the file system data is probably
untouched. From man zpool:
zpool export [-f] pool ...
Exports the given pools from the system. All devices are
marked as exported, [...]
Before exporting the pool, all datasets within the pool
are unmounted.
For pools to be portable, you must give the zpool com-
mand whole disks, not just slices, so that ZFS can label
the disks with portable EFI labels. Otherwise, disk
drivers on platforms of different endianness will not
recognize the disks.
3) In a large pool with several file systems is there any way to image a
single file system?
Regards
Mark
On Friday 27 July 2007 11:37, Darren J Moffat <darrenm at opensolaris.org> may
have written:
> Mark Furner wrote:
> > PREPARE LOOPBACK DEVICE
> > note need full path for file
> >
> > root at sol10 /export/home# lofiadm -a /export/home/t1_fs1.COPY.dd
> > /dev/lofi/1 root at sol10 /export/home# lofiadm
> > Block Device File
> > /dev/lofi/1 /export/home/t1_fs1.COPY.dd
> > root at sol10 /export/home#
> >
> > ZFS MOUNT OF LOOPBACK DEVICE DOESNT WORK
> >
> > root at sol10 /export/home# zfs mount -o
> > noexec,nosuid,noatime,nodevices,ro /dev/lofi/1 /fs1
> > too many arguments
>
> That is the wrong level of abstraction for ZFS. The file you have is a
> pool not a filesystem. That means you need to import the pool into the
> system before you can see the filesystems.
>
> For example:
>
> oversteer:pts/1# zpool create -f test c0t0d0s7
> oversteer:pts/1# zpool export test
> oversteer:pts/1# dd if=/dev/dsk/c0t0d0s7 of=/var/tmp/c0t0d0s7.copy
> 144585+0 records in
> 144585+0 records out
> oversteer:pts/1# zpool import -d /var/tmp
> pool: test
> id: 8033455162408061258
> state: ONLINE
> action: The pool can be imported using its name or numeric identifier.
> config:
>
> test ONLINE
> /var/tmp/c0t0d0s7.copy ONLINE
>
> You don't need to use lofiadm at all but you do need to first import the
> pool using zpool import.
>
> --
> Darren J Moffat