Robert Milkowski
2005-Dec-14 09:37 UTC
[zfs-discuss] format(1M) quits if there are pools on disks and no zfs module
Hi. While submitting SDR-0149 on ZFS bug I encountered problem with format utility. This is v240 with snv_29 with internal disks. On s0 slices there is zfs pool (which is not imported). I did unload zfs modules then moved zfs driver and run format. Now format quits just because there''s no zfs module (and not even one zfs pool is imported). It shouldn''t behave that way. (problem with ZFS itself - that it couldn''t import that pool is issued separatelly on ZFS portal with id: SDR-0149) bash-3.00# modunload -i 0 bash-3.00# modunload -i 0 bash-3.00# mv /kernel/drv/sparcv9/zfs /kernel/drv/sparcv9/zfs.orig bash-3.00# format -em Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci at 1c,600000/scsi at 2/sd at 0,0 1. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci at 1c,600000/scsi at 2/sd at 1,0 2. c1t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci at 1c,600000/scsi at 2/sd at 2,0 3. c1t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci at 1c,600000/scsi at 2/sd at 3,0 Specify disk (enter its number): 0 selecting c1t0d0 [disk formatted] Warning: Current Disk has mounted partitions. internal error: cannot open zfs device bash-3.00# I did use format(1M) from S10 and it works. While I like that improved format tries to help the admin not to shot his own shoe an override (-force) option should be provided. And it should''t report not imported zfs pool as in use (slices in use by the pool). As David Bustos pointed out it looks similar to the bug <a href="http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6345023">6345023</a> This message posted from opensolaris.org
Eric Schrock
2005-Dec-14 15:35 UTC
[zfs-discuss] format(1M) quits if there are pools on disks and no zfs module
On Wed, Dec 14, 2005 at 01:37:20AM -0800, Robert Milkowski wrote:> Hi. > While submitting SDR-0149 on ZFS bug I encountered problem with > format utility. This is v240 with snv_29 with internal disks. On s0 slices > there is zfs pool (which is not imported). I did unload zfs modules then > moved zfs driver and run format. Now format quits just because there''s no > zfs module (and not even one zfs pool is imported). It shouldn''t behave > that way.Actually, this is behaving as expected. The utility will try to dlopen() libzfs.so, so that if you don''t have SUNWzfsu installed, it will ignore any zpool checks. However, if you''ve mucked with your configuration in such a way as to have a working libzfs but no /dev/zfs device, you''re really on your own. This should never happen. It would be possible to fix this, but it would add some unwanted complexity for very little gain.> I did use format(1M) from S10 and it works. > While I like that improved format tries to help the admin not to shot his > own shoe an override (-force) option should be provided. And it should''t > report not imported zfs pool as in use (slices in use by the pool).I have a wad of fixes which include a change so that exported pools do not cause format (or other utilities) to complain. Only if the pool is actively in use on the system does it complain (with my fix). Hopefully this should make build 31. You should be able to work around this by setting ''NOINUSE_CHECK'' in your environment. - Eric -- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
Robert Milkowski
2005-Dec-15 12:06 UTC
[zfs-discuss] format(1M) quits if there are pools on disks and no zfs module
Hello Eric, Wednesday, December 14, 2005, 4:35:45 PM, you wrote: ES> On Wed, Dec 14, 2005 at 01:37:20AM -0800, Robert Milkowski wrote:>> Hi. >> While submitting SDR-0149 on ZFS bug I encountered problem with >> format utility. This is v240 with snv_29 with internal disks. On s0 slices >> there is zfs pool (which is not imported). I did unload zfs modules then >> moved zfs driver and run format. Now format quits just because there''s no >> zfs module (and not even one zfs pool is imported). It shouldn''t behave >> that way.ES> Actually, this is behaving as expected. The utility will try to ES> dlopen() libzfs.so, so that if you don''t have SUNWzfsu installed, it ES> will ignore any zpool checks. However, if you''ve mucked with your ES> configuration in such a way as to have a working libzfs but no /dev/zfs ES> device, you''re really on your own. This should never happen. Yeah, I know. I was doing it due to another bug and in order to import a pool I had to change s2 slice. But I could''t change it as format thinks it''s in use. Ayway fixes you describe below should solve this. ES> It would be possible to fix this, but it would add some unwanted ES> complexity for very little gain.>> I did use format(1M) from S10 and it works. >> While I like that improved format tries to help the admin not to shot his >> own shoe an override (-force) option should be provided. And it should''t >> report not imported zfs pool as in use (slices in use by the pool).ES> I have a wad of fixes which include a change so that exported pools do ES> not cause format (or other utilities) to complain. Only if the pool is ES> actively in use on the system does it complain (with my fix). Hopefully ES> this should make build 31. ES> You should be able to work around this by setting ''NOINUSE_CHECK'' in ES> your environment. Aha! So there''s an option after all! :) -- Best regards, Robert mailto:rmilkowski at task.gda.pl