12 Replies Latest reply on Dec 8, 2010 12:42 PM by bobvance

    How to delete a local VMFS partition

    foofighter26 Hot Shot

      Hi,

       

      We have an old ESX 2.5 blade server with local storage. A previous ESX Admin created a local VMFS called DMZOS I want to delete this volume what commands do I use?

       

      When I try to delete it from the MUI it does not work.

       

      regards,

       

      Paul

        • 1. Re: How to delete a local VMFS partition
          oreeh Guru

          Boot the Linux kernel and remove the partition using fdisk.

          • 2. Re: How to delete a local VMFS partition
            foofighter26 Hot Shot

            Is there noway to do this online as there are some production VM's on it?

             

            regards,

             

            Paul

            • 3. Re: How to delete a local VMFS partition
              oreeh Guru

              You can try it using fdisk when online - but I'm not sure of the results / possible drawbacks.

              • 4. Re: How to delete a local VMFS partition
                foofighter26 Hot Shot

                Ok thanks for that,

                 

                What is the fdisk command to delete a specific volume?

                 

                regards,

                 

                Paul

                • 5. Re: How to delete a local VMFS partition
                  oreeh Guru

                  You need to know the SCSI device for your local disk - this should be /dev/sda

                  To make sure type mount

                  this should print something like the following

                  /dev/cciss/c0d0p3 on / type ext3 (rw)

                  none on /proc type proc (rw)

                  none on /dev/pts type devpts (rw,gid=5,mode=620)

                  usbdevfs on /proc/bus/usb type usbdevfs (rw)

                  /dev/cciss/c0d0p1 on /boot type ext3 (rw)

                  /dev/cciss/c0d0p9 on /home type ext3 (rw)

                  /dev/cciss/c0d0p6 on /opt type ext3 (rw)

                  none on /dev/shm type tmpfs (rw)

                  /dev/cciss/c0d0p8 on /tmp type ext3 (rw)

                  /dev/cciss/c0d0p7 on /var type ext3 (rw)

                  /dev/cciss/c0d0p5 on /vmimages type ext3 (rw)

                  /code

                   

                  if you get an output with /dev/sdaX then /dev/sda is the needed device

                  in my case it is /dev/cciss/c0d0

                   

                  Run fdisk /dev/cciss/c0d0

                  then type p

                  this should print something similar to the following

                   

                             Device Boot    Start       End    Blocks   Id  System

                  /dev/cciss/c0d0p1   *         1        32    257008+  83  Linux

                  /dev/cciss/c0d0p2            33     32200 258389460   fb  Unknown

                  /dev/cciss/c0d0p3         32201     32853   5245222+  83  Linux

                  /dev/cciss/c0d0p4         32854     35419  20611395    f  Win95 Ext'd (LBA)

                  /dev/cciss/c0d0p5         32854     34158  10482381   83  Linux

                  /dev/cciss/c0d0p6         34159     34419   2096451   83  Linux

                  /dev/cciss/c0d0p7         34420     34680   2096451   83  Linux

                  /dev/cciss/c0d0p8         34681     34941   2096451   83  Linux

                  /dev/cciss/c0d0p9         34942     35202   2096451   83  Linux

                  /dev/cciss/c0d0p10        35203     35406   1638598+  82  Linux swap

                  /dev/cciss/c0d0p11        35407     35419    104391   fc  Unknown

                  /code

                  the partition containing the VMFS is the one with type FB

                  (in this case the second)

                  to delete the partition type d

                  you will be asked for the number

                  enter it and the partition is gone

                  then type w to write out the partition table to the disk, then type q to exit

                  • 6. Re: How to delete a local VMFS partition
                    foofighter26 Hot Shot

                    /dev/cciss/c0d0p1             1        13     53024   83  Linux

                    /dev/cciss/c0d0p2            14      4645  18898560   fb  Unknown

                    /dev/cciss/c0d0p3          4646      5288   2623440   83  Linux

                    /dev/cciss/c0d0p4          5289     17433  49551600    f  Win95 Ext'd (LBA)

                    /dev/cciss/c0d0p5          5289      5674   1574864   82  Linux swap

                    /dev/cciss/c0d0p6          5675      5931   1048544   83  Linux

                    /dev/cciss/c0d0p7          5932      6188   1048544   83  Linux

                    /dev/cciss/c0d0p8          6189      6213    101984   fc  Unknown

                    /dev/cciss/c0d0p9          6214     17433  45777584   fb  Unknown

                     

                    This is my print I seem to have to FB types how do I know which it is?

                     

                    regards,

                     

                    Paul

                    • 7. Re: How to delete a local VMFS partition
                      oreeh Guru

                      You have a partition with type FC (/dev/cciss/c0d0p8) this is your swap partition.

                      And have a partition with type FB (/dev/cciss/c0d0p9) this is your vmfs  partition.

                      1 person found this helpful
                      • 8. Re: How to delete a local VMFS partition
                        foofighter26 Hot Shot

                        Thanks for all your help.

                         

                        regards,

                         

                        Paul

                        • 9. Re: How to delete a local VMFS partition
                          mcwill Expert

                          /dev/cciss/c0d0p2  is also a VMFS partition but less that half the size of /dev/cciss/c0d0p9

                           

                          You should be able to figure out which of the two you wish to delete based upon their size.

                          1 person found this helpful
                          • 10. Re: How to delete a local VMFS partition
                            oreeh Guru

                            Yes - I was blind

                            • 11. Re: How to delete a local VMFS partition
                              AFBICVMAdmins Lurker

                              I have this same problem.   When I run the commands, this is what I get.  As you can see below, when I run the d command, it wipes out all the partitions below.   That can't be good.  What am I doing wrong?

                               

                              Disk /dev/cciss/c0d0: 587.2 GB, 587243921408 bytes

                              255 heads, 63 sectors/track, 71395 cylinders

                              Units = cylinders of 16065 * 512 = 8225280 bytes

                               

                                         Device Boot    Start       End    Blocks   Id  System

                              /dev/cciss/c0d0p1   *         1        13    104391   83  Linux

                              /dev/cciss/c0d0p2            14      1057   8385930   83  Linux

                              /dev/cciss/c0d0p3          1058      1318   2096482+  82  Linux swap

                              /dev/cciss/c0d0p4          1319     71395 562893502+   f  Win95 Ext'd (LBA)

                              /dev/cciss/c0d0p5          1319      5234  31455238+  83  Linux

                              /dev/cciss/c0d0p6          5235      5756   4192933+  83  Linux

                              /dev/cciss/c0d0p7          5757      6278   4192933+  83  Linux

                              /dev/cciss/c0d0p8          6279      6291    104391   fc  Unknown

                               

                              Command (m for help): d

                              Partition number (1-8): 4

                               

                              Command (m for help): p

                               

                              Disk /dev/cciss/c0d0: 587.2 GB, 587243921408 bytes

                              255 heads, 63 sectors/track, 71395 cylinders

                              Units = cylinders of 16065 * 512 = 8225280 bytes

                               

                                         Device Boot    Start       End    Blocks   Id  System

                              /dev/cciss/c0d0p1   *         1        13    104391   83  Linux

                              /dev/cciss/c0d0p2            14      1057   8385930   83  Linux

                              /dev/cciss/c0d0p3          1058      1318   2096482+  82  Linux swap

                              • 12. Re: How to delete a local VMFS partition
                                bobvance Enthusiast

                                If you're going to be fooling with partitions, you should know something about partitioning.

                                You can Google "MBR" or "Partition Table".

                                 

                                The basics:

                                There are two basic types of partitions on an MBR disk:

                                   Primary

                                   Extended

                                ((

                                most PC-style systems use MBR, including ESX (however, 64-bit Win2k8 uses the new GPT partitioning)

                                ))

                                MBR can have 1, 2, 3 or 4 primaries.

                                You can have only 1 Extended.

                                If you have an extended, it uses up one Primary slot, so you'd only have up to 3 Primaries in this case.

                                The extended partition is essentially a special type of Primary that has its own embedded partition table, allowing for "sub" partitions or "Logical" partitions.

                                 

                                In your case, the first 3 partitions are primary and the 4th is Extended (the type column = "f Win95 Ext'd (LBA)".

                                The other partitions, 5-8, are all logical partitions within the 4th partition.

                                (check the starting and ending block and you'll see).

                                 

                                *SO*, deleting the 4th partition deleted the Extended partition and took all the Logical, sub-partitions with it.

                                 

                                bv