cloudbase / wnbd

Windows Ceph RBD NBD driver
GNU Lesser General Public License v2.1
58 stars 26 forks source link

How to use rbd-wnbd to fix the drive letter on windows10? #135

Closed luckyho closed 7 months ago

luckyho commented 7 months ago

I formatted the rbd image and installed the system image and specified the drive letter T. Then I cloned the rbd image and mapping the cloned image to other windows machines. The drive letter of the cloned image is Automatically assigned, such as drive letter E.

In this scenario, how can I ensure that the drive letter of this cloned image is T after mapping?

petrutlucian94 commented 7 months ago

Hi,

Windows drive letters are not preserved when the disks are reattached to other hosts. Here are a few alternatives:

  1. Use volume GUID paths such as \\?\Volume{b3fcaf41-c404-4942-9720-4e60d62217e1}\. The GUID will be preserved, however not all Windows applications can handle such paths.

  2. Identify the drive letter based on the volume id or filesystem label:

    
    PS C:\> get-volume | ? { $_.UniqueId -eq '\\?\Volume{b3fcaf41-c404-4942-9720-4e60d62217e1}\' }

DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining


T test1g NTFS Fixed Healthy OK 993.12 MB

PS C:> get-volume | ? { $_.FileSystemLabel -eq "test1g" }

DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining


T test1g NTFS Fixed Healthy OK 993.12 MB

3. Probably the best option: use volume mount points (access points) instead of relying on drive letters:

PS C:> mkdir C:\mnt\test_1g\ -force PS C:> Get-Partition -DriveLetter t | Add-PartitionAccessPath -AccessPath C:\mnt\test_1g\



I'll go ahead and close this issue since it concerns Windows partition access points and not WNBD in particular. Let me know if you have any further questions though.