4 Replies Latest reply on Jun 17, 2013 8:57 AM by Jim Wilson

    NSH Script to Format New Disk

      Hi,

       

      I am working in CLM 3.1 and I created a post-deploy action to add addition system disk to the provisioned VM. CLM adds the new disk to the VM but its not available for the user. Looks like we have to manually create a volume out of that disk. In the CLM docs they mentioned that we can add a custom NSH script to format the newly added disk automatically. Please send me an sample NSH script to format the disk. And, is there any programming guide for doing NSH script developing? Let me know if you have any questions.

       

      Regards,

      Senthil.

        • 1. Re: NSH Script to Format New Disk
          Aryan Anantwar

          Hi Senthil,

           

          Contact Support for custom NSH script to format the newly added disk automatically.

           

          Following docs will be helpful to work wit NSH.

           

          https://docs.bmc.com/docs/display/public/bsa83/Working+with+Network+Shell

          https://docs.bmc.com/docs/display/public/bsa83/Summarized+descriptions+of+Network+Shell+commands

           

          Regards,

          Aryan Anantwar

          • 2. Re: NSH Script to Format New Disk
            Siddu angadi

            Hi Senthil,

             

            I assume it is for windows operation system.

            Use the FORMAT dos command in conjuction with "nexec" syntax of NSH Command. basically nexec command is used to trigger os native command utility. There are so many ways to achieve your requirement.

             

            below is the DOS command for format:

             

            FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X]
            FORMAT volume [/V:label] [/Q] [/F:size]
            FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors]
            FORMAT volume [/V:label] [/Q] [/1] [/4]
            FORMAT volume [/Q] [/1] [/4] [/8]

            volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
            /FS:filesystemSpecifies the file system (FAT, FAT32, or NTFS).
            /V:labelSpecifies the volume label.
            /QPerforms a quick format.
            /CFiles created on the new volume will be compressed by default.
            /XForces the volume to dismount first if necessary. All opened handles to the volume would no longer be valid.
            /A:sizeOverrides the default allocation unit size. Default settings are strongly recommended for general use.
            NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
            FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).
            FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).

            Note that the FAT and FAT32 files systems impose the below restrictions on the number of clusters on a volume:

            FAT: Number of clusters <= 65526 FAT32: 65526 < Number of clusters < 268435446

            Format will immediately stop processing if it decides that the above requirements cannot be met using the specified cluster size.

            NTFS compression is not supported for allocation unit sizes above 4096.

            /F:sizeSpecifies the size of the floppy disk to format (160,
            180, 320, 360, 640, 720, 1.2, 1.23, 1.44, 2.88, or 20.8).
            /T:tracksSpecifies the number of tracks per disk side.
            /N:sectorsSpecifies the number of sectors per track.
            /1Formats a single side of a floppy disk.
            /4Formats a 5.25-inch 360K floppy disk in a high-density drive.
            /8Formats eight sectors per track.
            • 3. Re: NSH Script to Format New Disk
              Akbar Aziz

              If it's windows, you can call the native diskpart utility to format and initialize the new disk as part of your post-provisioning job.

               

              List of diskpart commands:

               

              http://technet.microsoft.com/en-us/library/cc766465(v=ws.10).aspx

              • 4. Re: NSH Script to Format New Disk
                Jim Wilson

                Hi Senthil,

                 

                Did this get resolved?

                If so, please can you update the discussion thread with details so that is can be marked as answered.

                 

                Thanks & Regards,

                Jim (Forum Manager/Facilitator)