Looking thru the cmds in man zfs and man zpool, and having watched 2 of the basic demos, I wasn''t left with confidence about how to carry out common file system tasks. I''m sorry if this seems horribly obvious but I often a hard time getting simple stuff through my extra thick skull. zfs uses `create'' to make directories inside a zpool. Or so it seems from the demos. What about other actions like (mv)move (cp)copy (mv)rename (rm)delete etc etc. The `rename'' in man zfs appear to be about something more than files and directories. Same for `destroy'' compared to `rm''. I see no action like `mv''.. unless `rename'' is used that way. OK, a real situation: created zpool and a few basic directories with `zfs create'' From another OS, a win xp backup tool (acronis) connects to the cifs share ..zbk/ and creates a directory and file name... or so I thought. But it turns out I was sloppy in the naming from the windows side. Instead of /zbk/hosts/mob1/022009-full.tib I got /zbk/hosts/mob1022009-full.tib I''d left out one `/'' so now I need to create the directory mob1 and rename mob1022009-full.tib to /zbk/hosts/mob1/022009-full.tib So, do I just use the normal unix tools (mkdir and mv) to handle this? Will allowing my user from other OS''s to create directories and name files cause me any grief. I guess what I''m asking is: Does a zfs user do common file system chores with standard unix tools inside a zpool?
On Fri, 20 Feb 2009, Harry Putnam wrote:> > zfs uses `create'' to make directories inside a zpool. Or so it seems > from the demos.If it helps with understanding, these are complete filesystems (like an NTFS volume) rather than just directories (part of some other filesystem). When comparing zfs with a tree, the pool is the trunk of the tree while the filesystems are the main branches where they join with the trunk. The twigs are directories, and the files are like leaves.> What about other actions like (mv)move (cp)copy (mv)rename (rm)delete > etc etc.Those work within filesystems.> The `rename'' in man zfs appear to be about something more than files > and directories.It works for filesystems, volumes, and snapshots. So it looks like this should work for you zfs rename oldname newname The oldname and newname need to be in the same pool.> But it turns out I was sloppy in the naming from the windows side. > > Instead of /zbk/hosts/mob1/022009-full.tib > > I got /zbk/hosts/mob1022009-full.tib > > I''d left out one `/'' so now I need to create the directory mob1 > and rename mob1022009-full.tib to > /zbk/hosts/mob1/022009-full.tibTry zfs rename zbk/hosts/mob1022009-full.tib zbk/hosts/mob1/022009-full.tib Maybe that will work (assuming that these are zfs filesystems and not ordinary files or directories). I am not quite sure what you have done. Do zfs list -r poolname to list all of the zfs filesystems in the pool.> Will allowing my user from other OS''s to create directories and name > files cause me any grief.Your windows user won''t be able to create zfs filesystems. They will be able to create directories and files in filesystems. Otherwise things should be fine.> I guess what I''m asking is: Does a zfs user do common file system > chores with standard unix tools inside a zpool?Other than when dealing with the top zfs pools, and zfs filesystems, the answer to this is yes. If this was not the case, then the system would not be very useful. Bob -- Bob Friesenhahn bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Bob Friesenhahn <bfriesen at simple.dallas.tx.us> writes: I created a receptacle with zpool zpool create zbk raidz1 c5t0d0 c5t1d0 c5t2d0 (With compression turned on) As seen my zfs zfs list zbk NAME USED AVAIL REFER MOUNTPOINT zbk 106G 50.5G 106G /zbk As seen by zpool zpool list zbk NAME SIZE USED AVAIL CAP HEALTH ALTROOT zbk 238G 158G 79.6G 66% ONLINE - BobF wrote:> Other than when dealing with the top zfs pools, and zfs filesystems, > the answer to this is yes. If this was not the case, then the system > would not be very useful.It sure wouldn''t. That was first take but like I said I wasn''t that confident about being right. Its looking like I botched the job already. My intent was to create one top level zfs files system in the pool. But after your helpful and explanatory reply I see I carelessly mixed things up so that I used `zfs create'' where I should have used mkdir zfs list -r zbk NAME USED AVAIL REFER MOUNTPOINT zbk 106G 50.5G 106G /zbk zbk/mob1 101K 50.5G 28.0K /zbk/mob1 zbk/mob1/acronis 49.3K 50.5G 25.3K /zbk/mob1/acronis zbk/mob1/acronis/022009 24.0K 50.5G 24.0K /zbk/mob1/acronis/022009 zbk/mob1/ghost 24.0K 50.5G 24.0K /zbk/mob1/ghost ls -lR /zbk|grep ''^/'' /zbk: /zbk/chub: /zbk/chub/ghost: /zbk/chub/ghost/021909: /zbk/harvey: /zbk/harvey/ghost: /zbk/harvey/ghost/022009: /zbk/mob1: /zbk/mob1/acronis: /zbk/mob1/acronis/022009: /zbk/mob1/ghost:> zfs rename zbk/hosts/mob1022009-full.tib zbk/hosts/mob1/022009-full.tibProbably the wrong move now that its clear how I screwed this up. I''m thinking something like this might clean things up? cd /rbk Starting with: ls -F . chub/ harvey/ mob1/ mob1MyBackup.tib zfs destroy -r mob1 mkdir -p mob1/acronis/022009/ mob1/ghost mv mob1MyBackup.tib mob1/acronis/022009/mob1_01.tib Is this about right... since there are no actual files under the zfs file system `mob1/'', I can just get rid of it as shown above. And create the hierarchy I intended with standard tools mkdir and mv? I think I''ll wait for a reply before I do any of that...
On Sat, 21 Feb 2009, Harry Putnam wrote:> Probably the wrong move now that its clear how I screwed this up. > > I''m thinking something like this might clean things up? > > cd /rbk > > Starting with: > ls -F . > chub/ harvey/ mob1/ mob1MyBackup.tib > > zfs destroy -r mob1 > > mkdir -p mob1/acronis/022009/ mob1/ghost > > mv mob1MyBackup.tib mob1/acronis/022009/mob1_01.tib > > Is this about right... since there are no actual files under the zfs > file system `mob1/'', I can just get rid of it as shown above. And > create the hierarchy I intended with standard tools mkdir and mv?You might want to think a bit more before you get started. While there is an implicit usable filesystem at the pool root (''/rbk''), there is considerable value with creating subordinate filesystems using ''zfs create'' because then you will be able to manage them much better using different settings such as block sizes, mount points, quotas, and other goodies that ZFS provides. If the directories are for users, then being able to set a quota is quite useful since some users need a firewall to protect to ensure that they don''t use all of the disk space. Note that you can set the mountpoint for any ZFS filesystem via the "mountpoint" property (see zfs manual page) and this will cause that filesystem to appear via the path you specify. Don''t feel that the name of the pool needs to drive your directory heirarchy. In fact, it is wise if the pool name is not part of any of the paths used. By using the mountpoint property you can create any number of mounted directories directly off of root (''/''), or under any other directory. For example, you can easily set the mount path to "/mydir". Bob -- Bob Friesenhahn bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Bob Friesenhahn <bfriesen at simple.dallas.tx.us> writes:> You might want to think a bit more before you get started. While > there is an implicit usable filesystem at the pool root (''/rbk''), > there is considerable value with creating subordinate filesystems > using ''zfs create'' because then you will be able to manage them much > better using different settings such as block sizes, mount points, > quotas, and other goodies that ZFS provides. If the directories are > for users, then being able to set a quota is quite useful since some > users need a firewall to protect to ensure that they don''t use all of > the disk space.Ahh I see. The users are not real users... just my home lan connecting to backup other machines onto the zfs pool. But I see your point. And considering the whole thing is experimental at this point; (I''m running zfs from a opensol install inside a vmware on windows xp, hoping to find out some of the gotchas and good practices before putting a real zfs server into operation on the home lan. I think I will scrub this setup leaving zbk/ as the main pool then create xfs filesystems like: zbk/HOST1 zbk/HOST2 zbk/HOST3 (etc) zbk/misc And set the HOST[123]/ and pub/ as the cifs shares, instead of the top level. That would give quite a bit more granularity.. maybe I''ll learn a little more this way too.