Subscribe
Accepted Solution

SnapDrive for Linux, mount using absolute path

I'm using snapdrive for Linux and have a question about its usage. 

Is it possible to connect all filesystems within a snapshot to the host using an absolute path?   I would like to mount all volumes within a diskgroup to an absolute location such as /backup.

So for instance if I have a volume group with three logical volumes normally mounted as:

/a

/b

/c

I would like to be able to run a snap connect command that will mount them automatically to /backup/a, /backup/b, /backup/c. 

The -autorename function just appends a _1 to the existing path.. which is not terribly useful!

Any help would be appreciated.

Thanks!

Re: SnapDrive for Linux, mount using absolute path

Hello Ralph,

You can try something as shown below:

# df -k

/dev/mapper/vg1-lvol1

                         11895      1138     10143  11% /mnt/sdu1

/dev/mapper/vg1-lvol2

                         11895      1138     10143  11% /mnt/sdu2

# snapdrive snap create -vg vg1 -snapname snapvg1

[root@node2 ~]# snapdrive snap connect -fs /mnt/sdu1 /mnt/a -destvg vg2 -fs /mnt/sdu2 /mnt/b -destvg vg2 -snapname filer:/vol/volsdu:snapvg1

connecting vg1:

        creating unrestricted volume clone filer:/vol/Snapdrive_volsdu_volume_clone_from_snapvg1_snapshot ... success

        mapping new lun(s) ... done

        discovering new lun(s) ... done

        Importing vg2

Successfully connected to snapshot filer:/vol/volsdu:snapvg1

        disk group vg2 containing host volumes

                lvol1 (filesystem: /mnt/a)

                lvol2 (filesystem: /mnt/b)

Thanks,

Himanshu

Re: SnapDrive for Linux, mount using absolute path

Thanks Himanshu.   I was aware that I could specify source and destination mount locations.. unfortunately in my environment I am dealing with dozens of them so it's a pain to do manually and complex to script.  Ideally what I need is something like:

snapdrive snap connect vg1 vg2 -path /newmountpoint

Which would be a simple way of just saying.. take the stuff that's in the snapshot and mount it relative to /newmountpoint.  Now that I think about it, I actually have this question titled incorrectly - what I need is a way to mount it using a relative path!  Oops!

Re: SnapDrive for Linux, mount using absolute path

Ralph,

There is no way in SnapDrive to mount the entities on a relative path. You either have to mention all paths with or use -autorename option.

Thanks,

Himanshu

Re: SnapDrive for Linux, mount using absolute path

Thanks Himanshu!