ONTAP Discussions

Any way to convert qtrees to directories?

bryanfmoss
5,996 Views

Hello Netapp Community,

I have a situation where I need to move data out of qtrees and into root level directories on a flexvol.  I have looked at options for ndmp and other copy methods but they are all very cumbersome.  Our need calls for maintaining the current names and vol location and just eliminating the qtrees and their associated security styles.  It will all match the vol level security.

Do any of you know of any method to convert a qtree to a directory?   Can it be done with an inode remap or anything like that? Is there any sort of attribute that could be removed to have it convert to a directory instead of a qtree? 

Any thoughts or ideas you have would be greatly appreciated!

8 REPLIES 8

reena
5,996 Views

Why not just change the security style of the Qtree to match the parent volume security style, if that’s the main concern.

Reena

bryanfmoss
5,996 Views

Well, it is not actually about the security style, I just called that out so everyone could know they are the same.  They are all the same security style already.  Thanks for the reply though!

scottgelb
5,996 Views

In advanced mode, there is a mv commnd that will move individual files anywhere within the same volume, but it won't move a directory or qtree, so a lot of mv commands possibly... and no documents I can find that support moving files with this method, but it is an ontap advanced command you can try (maybe do with a flexclone or mirrored copy to test it).

bryanfmoss
5,996 Views

Yeah, have kind of looked at the as an option as well but it is just as cumbersome if not more as the NDMP commands.

The requirement is to remove the qtrees.  We have an application that does not like the qtree attribute and it is causing errors so we want to just remove the qtrees since we aren't using quotas or QSM and don't really need them at this point.

Thanks for the reply, hoping someone still has some trick up their sleeve. 

scottgelb
5,996 Views

ndmpcopy is probably the best way... but mv won't do a copy and is an immediate pointer swap, but probably way too cumbersome like you said.

How does the app know it is a qtree?  What if you create the share/export at the qtree level?

aborzenkov
5,996 Views

What about just creating top-level directory, moving content of qtree into it and then renaming to original qtree name. Moving files between directories is pretty fast, even for large number of entries.

There are some things to watch out doing it, but this would be the fastest way.

abuchmann
5,996 Views

The move command is fast, as long as you're moving data inside the same filesystem. A qtree is a sub-filesystem, so the data has to be copied.

ndmpcopy is the best solution.

scottgelb
5,996 Views

From a host mounted to volume it move would copy.  However, the ONTAP "mv" commmand from advanced mode is a pointer swap in my experience.  It is a command local on the controller and not from a host.  Similarly, lun move will not only rename a lun but move it anywhere within the same volume (to the volume root or another qtree in the volume).

I created a 2KB file and took a 2.5GB RAR file and put them in a qtree /vol/test/qtree1 to show two files with large size differences.  I then ran the ONTAP "mv" command to move the two files to the root of the volume.  Both moves were instant.  There was no time difference and the 2.5G file would take some time if a copy.  From within ONTAP the command is a pointer swap anywhere within the volume qtree or not.  There is a chance it is doing a background copy and reporting the file move instantly but I don't think that is the case.

     fas-test*> mv /vol/test/qtree1/2K-file        /vol/test/2K-file       # instant
     fas-test*> mv /vol/test/qtree1/2.5G-file     /vol/test/2.5G-file   # instant

     fas-test*> ls /vol/test                                   # the files in the qtree are instantly moved under the volume
          .
          ..
          qtree1
          2K-file
          2.5G-file

Public