This might sound sooo simple, but it isn''t. I read the ZFS Administration Guide and it did not give an answer; at least no simple answer, simple enough for me to understand. The intention is to follow the thread "Easiest way to replace a boot disk with a larger one". The command given would be zpool attach rpool /dev/dsk/c1d0s0 /dev/dsk/c2d0s0 as far as I understand in my case. What it says is "cannot open ''/dev/dsk/c2d0s0'': No such device or address". format shows that the partition exists: # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1d0 <DEFAULT cyl 17020 alt 2 hd 255 sec 63> /pci at 0,0/pci-ide at 9/ide at 0/cmdk at 0,0 1. c2d0 <DEFAULT cyl 10442 alt 2 hd 255 sec 126> /pci at 0,0/pci-ide at 9/ide at 1/cmdk at 0,0 Specify disk (enter its number): 1 selecting c2d0 Controller working list found [disk formatted, defect list found] FORMAT MENU: [...] Total disk size is 38912 cylinders Cylinder size is 32130 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== == 1 Linux native 0 19 20 0 2 Solaris2 19 10462 10444 27 3 Other OS 10463 13074 2612 7 4 EXT-DOS 13075 38912 25838 66 [...] To my understanding, there is no need to format before using a file system in ZFS. The "Creating a Basic ZFS File System" is not clear to me. The first (and only) command it offers, creates a mirrored storage of a whole disk; none of which I intend to do. (I suggested before, to offer a guide as well containing all the *basic* commands.) I wonder if I really need to use format->partition first to create slice s0 in that second (DOS)partition of c2d0 before ZFS can use it? Thanks, Uwe -- This message posted from opensolaris.org
On Sat, Dec 20, 2008 at 11:52 AM, Uwe Dippel <udippel at gmail.com> wrote:> This might sound sooo simple, but it isn''t. I read the ZFS Administration Guide and it did not give an answer; at least no simple answer, simple enough for me to understand. > The intention is to follow the thread "Easiest way to replace a boot disk with a larger one". > The command given would be > zpool attach rpool /dev/dsk/c1d0s0 /dev/dsk/c2d0s0 > as far as I understand in my case. What it says is "cannot open ''/dev/dsk/c2d0s0'': No such device or address". format shows that the partition exists:The output you gave shows that there is an fdisk partition. If you''re going to use it then you''ll need to at the very least put a label on it. format -> partition should offer to label it. You can then set the size of s0 (to be the same as s2, if you want to use the full disk), and write the label again. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
Thanks, Peter! (and I really wished the Admin Guide was more practical). So we still do need the somewhat arcane format->partition-> tool! I guess, the step that ZFS saves is newfs, then?! Uwe -- This message posted from opensolaris.org
On Sat, Dec 20, 2008 at 1:11 PM, Uwe Dippel <udippel at gmail.com> wrote:> Thanks, Peter! > > (and I really wished the Admin Guide was more practical). So we still do need the somewhat arcane format->partition-> tool! I guess, the step that ZFS saves is newfs, then?!If you want to use the whole disk then zfs will do it all for you; you just need to define partitions/slices if you''re going to use slices. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
On Sat, Dec 20, 2008 at 03:52:46AM -0800, Uwe Dippel wrote:> This might sound sooo simple, but it isn''t. I read the ZFS Administration Guide and it did not give an answer; at least no simple answer, simple enough for me to understand. > The intention is to follow the thread "Easiest way to replace a boot disk with a larger one". > The command given would be > zpool attach rpool /dev/dsk/c1d0s0 /dev/dsk/c2d0s0 > as far as I understand in my case. What it says is "cannot open ''/dev/dsk/c2d0s0'': No such device or address". format shows that the partition exists:The problem is that fdisk partitions are not the same as Solaris partitions. The admin guide refers to a Solaris partition. For Solaris 10 x86, this has to be created inside an fdisk partition.> # format > Searching for disks...done > AVAILABLE DISK SELECTIONS: > 0. c1d0 <DEFAULT cyl 17020 alt 2 hd 255 sec 63> > /pci at 0,0/pci-ide at 9/ide at 0/cmdk at 0,0 > 1. c2d0 <DEFAULT cyl 10442 alt 2 hd 255 sec 126> > /pci at 0,0/pci-ide at 9/ide at 1/cmdk at 0,0 > Specify disk (enter its number): 1 > selecting c2d0 > Controller working list found > [disk formatted, defect list found] > FORMAT MENU: > [...] > Total disk size is 38912 cylinders > Cylinder size is 32130 (512 byte) blocks > > Cylinders > Partition Status Type Start End Length % > ========= ====== ============ ===== === ====== ==> 1 Linux native 0 19 20 0 > 2 Solaris2 19 10462 10444 27 > 3 Other OS 10463 13074 2612 7 > 4 EXT-DOS 13075 38912 25838 66These are fdisk partitions.> To my understanding, there is no need to format before using a file system in ZFS. > The "Creating a Basic ZFS File System" is not clear to me. The first (and only) command it offers, creates a mirrored storage of a whole disk; none of which I intend to do. (I suggested before, to offer a guide as well containing all the *basic* commands.) I wonder if I really need to use format->partition first to create slice s0 in that second (DOS)partition of c2d0 before ZFS can use it?The Solaris `format'' command is use to create Solaris partitions, and the label that describes them. For a ZFS root pool, you have to use a Solaris label, and a partition (slice). This was slice 0 in your example.
This is what I did: partition> print Current partition table (original): Total disk cylinders available: 10442 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 3 - 10441 159.93GB (10439/0/0) 335405070 1 unassigned wm 0 0 (0/0/0) 0 2 backup wu 0 - 10441 159.98GB (10442/0/0) 335501460 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 15.69MB (1/0/0) 32130 9 alternates wm 1 - 2 31.38MB (2/0/0) 64260 partition> quit But it won''t work. What is going wrong now??: # zpool attach rpool /dev/dsk/c1d0s0 /dev/dsk/c2d0s0 invalid vdev specification use ''-f'' to override the following errors: /dev/dsk/c2d0s0 overlaps with /dev/dsk/c2d0s2 Do I really need to ''-f'' this? Uwe -- This message posted from opensolaris.org
Gary, thanks. All my servers run OpenBSD, so I know the difference between a DOS-partition and a slice. :) My confusion is about the labels. I could not label it what I wanted, like zfsed or pool, it had to be root. And since we can have only a single bf-partition per drive (dsk), I was thinking ZFS would take the (existing but unlabeled) s0 to attach to. This does not seem to be the case. Out of curiosity: how does it matter (to ZFS) if /dsk/c3t1d0s0 is a complete drive or exists in a bf-partition? One way or another, /dev/dsk/c2d0s0 seems to be over-defined now. By the way, sorry to take your time. If what I want to do is described in a recipe-like manner, I will with pleasure receive and study that link. Thanks again, Uwe -- This message posted from opensolaris.org
On Sat, Dec 20, 2008 at 06:10:10AM -0800, Uwe Dippel wrote:> > thanks. All my servers run OpenBSD, so I know the difference between > a DOS-partition and a slice. :)My background is Solaris SPARC, where things are simpler. Solaris writes a label to a physical disk to define slices (Solaris partitions) on the disk. The `format'' command sees the physical disk. In the case of Solaris x86, this command sees one fdisk partition, which it treats as a disk. I generally create a single fdisk partition that occupies the entire disk, to return to simplicity.> My confusion is about the labels. I could not label it what I > wanted, like zfsed or pool, it had to be root. And since we can have > only a single bf-partition per drive (dsk), I was thinking ZFS would > take the (existing but unlabeled) s0 to attach to. This does not > seem to be the case.The tag that appears on the partition menu isn''t used in normal operation of the system. There are only a few valid choices, but `root'' is fine.> Out of curiosity: how does it matter (to ZFS) if /dsk/c3t1d0s0 is a > complete drive or exists in a bf-partition? > > One way or another, /dev/dsk/c2d0s0 seems to be over-defined now.If you give `zpool'' a complete disk, by omitting the slice part, it will write its own label to the drive. If you specify it with a slice, it expects that you have already defined that slice. For a root pool, it has to be a slice. -- -Gary Mills- -Unix Support- -U of M Academic Computing and Networking-
Now I modified the slice s0, so that is doesn''t overlap with s2 (the whole disk) any longer: Part Tag Flag Cylinders Size Blocks 0 root wm 3 - 10432 159.80GB (10430/0/0) 335115900 1 unassigned wm 0 0 (0/0/0) 0 2 backup wu 0 - 10441 159.98GB (10442/0/0) 335501460 but it still won''t do; at least not without ''-f''. I scare that something is wrong in my approach, since if I don''t create root s0, it won''t work, and if I create root s0, it isn''t happy neither and still says " /dev/dsk/c2d0s0 overlaps with /dev/dsk/c2d0s2". Actually, how could s0, or sN, not (partially) overlap with the whole disk? What is it that I don''t understand here? Uwe -- This message posted from opensolaris.org
On Sat, Dec 20, 2008 at 7:02 PM, Uwe Dippel <udippel at gmail.com> wrote:> Now I modified the slice s0, so that is doesn''t overlap with s2 (the whole > disk) any longer: > > Part Tag Flag Cylinders Size Blocks > 0 root wm 3 - 10432 159.80GB (10430/0/0) 335115900 > 1 unassigned wm 0 0 (0/0/0) 0 > 2 backup wu 0 - 10441 159.98GB (10442/0/0) 335501460 > > but it still won''t do; at least not without ''-f''. I scare that something is > wrong in my approach, since if I don''t create root s0, it won''t work, and if > I create root s0, it isn''t happy neither and still says " /dev/dsk/c2d0s0 > overlaps with /dev/dsk/c2d0s2". > Actually, how could s0, or sN, not (partially) overlap with the whole disk? > What is it that I don''t understand here? > > Uwe > <http://mail.opensolaris.org/mailman/listinfo/zfs-discuss>You''re making this far more difficult than it needs to be. Assuming you''ve already installed on the first disk, just do the following: prtvtoc /dev/dsk/c1t2d0s2 | fmthard -s - /dev/rdsk/c1t3d0s2 Where the cXtXdXs2 relate to your disk ID''s. You only do it for s2. After that you should have no issues. In your case I believe it would be: prtvtoc /dev/dsk/c1d0s2 | fmthard -s - /dev/rdsk/c2d0s2 --Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20081220/cb6b7588/attachment.html>
[i]prtvtoc /dev/dsk/c1d0s2 | fmthard -s - /dev/rdsk/c2d0s2[/i] Tim, I understand what you try to do here, and had thought of something likewise myself. But - please see my first post - it is not just a mirror that I want, the disk is of a different size, and so is the bf-partition. If I simply take the table and force it unto the new drive, I am afraid it might damage the other (DOS-)partitions; and even if not, it will maximally create a slice of the same size, which is not what I want. I need the whole, new, larger, bf-partition. Please, correct me if I''m wrong! Uwe -- This message posted from opensolaris.org
Uwe Dippel wrote:> Now I modified the slice s0, so that is doesn''t overlap with s2 (the whole disk) any longer: > > Part Tag Flag Cylinders Size Blocks > 0 root wm 3 - 10432 159.80GB (10430/0/0) 335115900 > 1 unassigned wm 0 0 (0/0/0) 0 > 2 backup wu 0 - 10441 159.98GB (10442/0/0) 335501460 > > but it still won''t do; at least not without ''-f''. I scare that something is wrong in my approach, since if I don''t create root s0, it won''t work, and if I create root s0, it isn''t happy neither and still says " /dev/dsk/c2d0s0 overlaps with /dev/dsk/c2d0s2". > Actually, how could s0, or sN, not (partially) overlap with the whole disk? What is it that I don''t understand here? >This is bug 6397079 which was closed as a dup of 6419310 http://bugs.opensolaris.org/view_bug.do?bug_id=6387079 http://bugs.opensolaris.org/view_bug.do?bug_id=6419310 workaround: after you have verified this is what you want to do, use -f -- richard
On Sat, 20 Dec 2008 17:02:31 PST Uwe Dippel <udippel at gmail.com> wrote:> Now I modified the slice s0, so that is doesn''t overlap with s2 (the > whole disk) any longer: > > Part Tag Flag Cylinders Size Blocks > 0 root wm 3 - 10432 159.80GB (10430/0/0) > 335115900 1 unassigned wm 0 0 > (0/0/0) 0 2 backup wu 0 - 10441 > 159.98GB (10442/0/0) 335501460I have a few ZFS disks running here with -NO- s2. You don''t -NEED- that slice, you know. Setting it to 0,0 is fine. Just make sure you leave part 0, 8 and 9 as they are and you''ll be fine. ZFS will use s0. -- Dick Hoogendijk -- PGP/GnuPG key: 01D2433D + http://nagual.nl/ | SunOS sxce snv104 ++ + All that''s really worth doing is what we do for others (Lewis Carrol)
Johan Hartzenberg
2008-Dec-21 10:37 UTC
[zfs-discuss] How to create a basic new filesystem?
On Sun, Dec 21, 2008 at 12:13 PM, dick hoogendijk <dick at nagual.nl> wrote:> On Sat, 20 Dec 2008 17:02:31 PST > Uwe Dippel <udippel at gmail.com> wrote: > > > Now I modified the slice s0, so that is doesn''t overlap with s2 (the > > whole disk) any longer: > > > > Part Tag Flag Cylinders Size Blocks > > 0 root wm 3 - 10432 159.80GB (10430/0/0) > > 335115900 1 unassigned wm 0 0 > > (0/0/0) 0 2 backup wu 0 - 10441 > > 159.98GB (10442/0/0) 335501460 > > As mentioned previously you do not need to fiddle with partitions andslices if you don''t want to use less than the entire disk. If you want to add the entire Solaris partition to the zfs pool as a mirror, use zpool attach -f rpool c1d0s0 c2d0s2 If you want to add the entire physical disk to the pool as a mirror, use zpool attach rpool c1d0s0 c2d0p0 If you want to Extend the pool using the space in the entire Solaris partition, use zpool add -f rpool c2d0s2 If you want to Extend the pool using the entire physical disk, use zpool add rpool c2d0p0 The -f to force is required to override the bug about s2 overlapping with other slices. The above assume you have not modified s2 to be anything other than the entire Solaris partition, as is the default. The only time to use anything other than s2 or p0 is when you specifically want to use less than the whole partition or disk. In that case you need to define slices/partitions. -- Any sufficiently advanced technology is indistinguishable from magic. Arthur C. Clarke My blog: http://initialprogramload.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20081221/d158182e/attachment.html>
[i]If you want to add the entire Solaris partition to the zfs pool as a mirror, use zpool attach -f rpool c1d0s0 c2d0s2[/i] So my mistake in the first place (see first post), in short, was only the last digit: I ought to have used the complete drive (slice 2), instead of *thinking* that it is untouchable, and zfs/zpool would set up s0 properly to be used? Dick, it seems we have to get used to the idea, that slice 2 is touchable, after all. Richard, thanks for the hint with the bug. But, we (I dunno, at least I) would definitively see something like what Johan wrote in the Admin Guide; instead of the marketing drool! Yes, I did what Richard proposed, it went through enormously well, and fast, and after around one hour resilvering had finished. I could do the grub-thingy (also here, the description is bad: one doesn''t make /dsk/ bootable, but /rdsk/), and then rebooting, the underlying (Linux) grub of the MBR/first partition came up, and with ''c'' I could change the chainloading from (hd0,1) to (hd1,1), and Nevada booted up very well and properly from the new drive. This is so much more advanced! If only the bugs were actually taken out, and even more importantly: it deserves a proper coherent and consistent documentation! QED: see subject! "How to create a basic new filesystem" The ZFS Admin Guide is silent on this. The ZFS Admin Guide is silent on s2. The ZFS Admin Guide does not even tackle the topic of a plurality of systems on a drive. Sorry for taking your precious time, but had there been a useful guide, I surely would have not seen the need to ask in the first place. Thanks for all your help! Uwe -- This message posted from opensolaris.org
On Sun, 21 Dec 2008 07:36:07 PST Uwe Dippel <udippel at gmail.com> wrote:> [i]If you want to add the entire Solaris partition to the zfs pool as > a mirror, use zpool attach -f rpool c1d0s0 c2d0s2[/i] > > So my mistake in the first place (see first post), in short, was only > the last digit: I ought to have used the complete drive (slice 2), > instead of *thinking* that it is untouchable, and zfs/zpool would set > up s0 properly to be used? > > Dick, it seems we have to get used to the idea, that slice 2 is > touchable, after all.That may be, but all my mirror disks are like c0d0s0 c0d1s0. s0 taking up the whole disk. On some there is a s2 on some there isn''t. Also, SUN itself mentions s0 in explaining zfs root as bootable. There is no mention of s2. As far as I''m concerned bootable ZFS is on s0; non-bootable drives have an EFI label ;-) -- Dick Hoogendijk -- PGP/GnuPG key: 01D2433D + http://nagual.nl/ | SunOS sxce snv104 ++ + All that''s really worth doing is what we do for others (Lewis Carrol)
Johan Hartzenberg
2008-Dec-23 09:20 UTC
[zfs-discuss] How to create a basic new filesystem?
On Sun, Dec 21, 2008 at 8:00 PM, dick hoogendijk <dick at nagual.nl> wrote:> On Sun, 21 Dec 2008 07:36:07 PST > Uwe Dippel <udippel at gmail.com> wrote: > > > [i]If you want to add the entire Solaris partition to the zfs pool as > > a mirror, use zpool attach -f rpool c1d0s0 c2d0s2[/i] > > > > So my mistake in the first place (see first post), in short, was only > > the last digit: I ought to have used the complete drive (slice 2), > > instead of *thinking* that it is untouchable, and zfs/zpool would set > > up s0 properly to be used? > > > > Dick, it seems we have to get used to the idea, that slice 2 is > > touchable, after all. > > That may be, but all my mirror disks are like c0d0s0 c0d1s0. s0 taking > up the whole disk. On some there is a s2 on some there isn''t. Also, SUN > itself mentions s0 in explaining zfs root as bootable. There is no > mention of s2. As far as I''m concerned bootable ZFS is on s0; > non-bootable drives have an EFI label ;-) >I believe there are some bugs at present pertaining to booting form ZFS which, in that special case, requires you to use slices. Where I gave examples for adding p0 or s2 to a pool, I was not thinking about bootable pools. The ZFS admin guide has got examples on how to add a mirror to a pool and explains the gotchas / workarounds for these issues, but from memory you have to read the whole guide to get all the information. I have not looked recently to see whether it got updated / re-organized.>From memory, the "issues" are related to the start / offset of the pool onthe disk which is added to the pool as a mirror, as well as the "manual" instalation of the bootblock on the disk added as a mirror. I can''t remember the details now, but the first requires that a slice be created manually with the correct offset, rather than using the whole disk. I have not tried it yet and don''t know the details of how to create this slice, or how the problem manifests itself. Right now I don''t have time to search for this information, but if the question is still open by the 10th of January I''ll look into it, though I''m sure someone else here will remember the details better than me. So to re-itterate, the exception is when adding disks to a bootable root-pool as a mirror. Otherwise, it is simple. -- Any sufficiently advanced technology is indistinguishable from magic. Arthur C. Clarke My blog: http://initialprogramload.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20081223/72b6378f/attachment.html>
Johan Hartzenberg wrote:> > > On Sun, Dec 21, 2008 at 8:00 PM, dick hoogendijk <dick at nagual.nl > <mailto:dick at nagual.nl>> wrote: > > On Sun, 21 Dec 2008 07:36:07 PST > Uwe Dippel <udippel at gmail.com <mailto:udippel at gmail.com>> wrote: > > > [i]If you want to add the entire Solaris partition to the zfs > pool as > > a mirror, use zpool attach -f rpool c1d0s0 c2d0s2[/i] > > > > So my mistake in the first place (see first post), in short, was > only > > the last digit: I ought to have used the complete drive (slice 2), > > instead of *thinking* that it is untouchable, and zfs/zpool > would set > > up s0 properly to be used? > > > > Dick, it seems we have to get used to the idea, that slice 2 is > > touchable, after all. > > That may be, but all my mirror disks are like c0d0s0 c0d1s0. s0 taking > up the whole disk. On some there is a s2 on some there isn''t. > Also, SUN > itself mentions s0 in explaining zfs root as bootable. There is no > mention of s2. As far as I''m concerned bootable ZFS is on s0; > non-bootable drives have an EFI label ;-) > > > I believe there are some bugs at present pertaining to booting form > ZFS which, in that special case, requires you to use slices.You can''t boot from an EFI labeled disk with UFS root either. It is a BIOS+GRUB+Solaris condition. I hate to point the finger elsewhere, but I don''t follow the install group''s activities very closely, and CR 6489977 is just a tracking bugid, dependent on the install group getting a grub or grub-like solution to handle EFI labels. http://bugs.opensolaris.org/view_bug.do?bug_id=6489977 A search may turn up: https://pl.opensolaris.org/jive/thread.jspa?threadID=82132&tstart=75> > Where I gave examples for adding p0 or s2 to a pool, I was not > thinking about bootable pools. The ZFS admin guide has got examples > on how to add a mirror to a pool and explains the gotchas / > workarounds for these issues, but from memory you have to read the > whole guide to get all the information. I have not looked recently to > see whether it got updated / re-organized.The whole section on boot with ZFS was added and enhanced for the Solaris 10u6 release. -- richard
Thanks, Richard, for another clarification! I personally always considered your post as enlightening and helpful. Thank you! It was not my intention to step on anyone''s feet with my remarks. I simply wished that there was a source of all that information that needed to be extracted from various sources for my - as far as I am concerned - very basic question. Had I known better, I hadn''t asked. Now it took me 24 hours to just get a new file system up. If a bug has been prevailing for 2.5 years, one better entered it into the Guide, eventually. Again, a good documentation starts from scratch and addresses the basic requirements. Personally, I consider it unfortunate that said passage in the ZFS Admin Guide starts with something like ''imagine you wanted to attach and mirror a drive dedicated to Solaris to an existing drive dedicated fully to Solaris'' (I am just to lazy to go there and copy from there.) That''s nothing like a Guide, sorry. The Guide should start from a partition, be it bf on ''DOS''/x86 or a slice. Whci is the command to prepare that partition (bf) or set of slices (SPARC) for ZFS? (And nothing else belongs here, AFAIAC) Which zpool command is it that takes or prepares the slice 2 such that later on I can set up a set of file systems on it? I guess there should be one, notwithstanding the fact that - later on - the whole raid/mirror can be done in a single go. [That something like this is acutely missing can be seen from this thread; including all the various, and to a good number contradictory messages I got, including offline. Do we need to create slices using format/partition? Can we use s0 (I found out, we can''t), can we use s2 (Johan thinks so), can we 0,0 s2 (Dick thinks so). Therefore, again, the basic commands are indispensable.] I do understand that it is a better sales argument to say, "If you wanted to get an exact copy of your partition /dev/sda4 on /dev/sdb5, for example, you''d issue dump -0ua -f - /dev/sda4 | restore -r -f - on a formatted and mounted file system /dev/sdb5." But that''s kind of crazy, isn''t it? Once you know all the commands, it is great. But in the first place, a good Guide introduces the building blocks, in this case dump and restore, and the relevant options, one by one. Probably with dumping to a file first. Many newcomers want to start playing, exploring , learning. Not everyone wants to run ZFS root&boot as one and only file system immediately. Why not start by fdisk-ing an empty partition on a supplementary drive? Preparing it for ZFS, including the eventual preparation of slices (if needed, format) Creating a pool. Creating file systems within the pool. Creating snapshots, destroying snapshots, and so forth. I for one would love to introduce ZFS in my field, tertiary education. But then I''d want building blocks. -- This message posted from opensolaris.org