# Windows Assign a mount point folder path to a drive : Ansible module ???

**URL:** <https://forum.ansible.com/t/windows-assign-a-mount-point-folder-path-to-a-drive-ansible-module/35025>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 21, 2021, 1:36pm UTC](https://forum.ansible.com/t/windows-assign-a-mount-point-folder-path-to-a-drive-ansible-module/35025 "2021-04-21T13:36:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandeep\_G](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@Sandeep\_G](https://forum.ansible.com/u/Sandeep_G)\
**Post date:** [April 21, 2021, 1:36pm UTC](https://forum.ansible.com/t/windows-assign-a-mount-point-folder-path-to-a-drive-ansible-module/35025/1 "2021-04-21T13:36:03Z")

</div>

have created a playbook for

1-Initialize a disk : USING win\_initialize\_disk

2-Create partition with drive letter (fullsize using -1) : USING win\_partition

3- Full format the newly created partition (6 drives D,E,F,G,H,I)as NTFS and label it: USING win\_format

Now my need is i have to create only d and F drive , and mount other partitions as mount volumes under F drive .

i couldn’t find any modules for win mount volume (Mount ntfs folder), Kindly help.

I need output like Only d and F is assigned and labelled and rest of the partitions should be under F as mounted volume/folder(There is no drive letters assigned to rest of the partitions (all are assigned under F drive as mount point))

Kindly help me on Ansible module way

---

<div class="post-metadata">

**Author:** ![jmul](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jmul](https://forum.ansible.com/u/jmul)\
**Post date:** [April 27, 2021, 2:53pm UTC](https://forum.ansible.com/t/windows-assign-a-mount-point-folder-path-to-a-drive-ansible-module/35025/2 "2021-04-27T14:53:53Z")

</div>

This is how I created the mountpoint after add the virtual disk on 2016 and above servers

- name: Online | Initialize | Format SQL Disk - Mountpoint  
win\_shell: |  
$Disk = @(Get-Disk | where-object{$_.OperationalStatus -eq ‘Offline’ -or $_.PartitionStyle -eq ‘RAW’} | sort Number )  
if($Disk.count -eq 1 ){  
try{  
$Disk | Initialize-Disk -PartitionStyle GPT -ErrorAction SilentlyContinue  
$Disk | New-Partition -UseMaximumSize -DriveLetter “E”  
$Partition = Get-Disk -Number $Disk[0].Number | Get-Partition | where{$_.type -eq ‘Basic’}  
$Partition | Format-Volume -FileSystem NTFS -Confirm:$false -AllocationUnitSize 65536 -NewFileSystemLabel “MOUNTPOINT (1:0)”  
}  
catch{  
$_.exception  
}  
}

and this is how i added the mountpoints to it
