def partition_mount_points(partitions)
      partitions.keys.sort do |a, b|
        a_count = a.count('/')
        b_count = b.count('/')

        if a_count > b_count
          v = 1
        else
          if a_count < b_count
            v = -1
          else
            if a.length == b.length
              v = a <=> b
            else
              v = a.length <=> b.length
            end
          end
        end

        # This forces having swap partition at the end of the disk
        v = 1 if a_count == 0
        v = -1 if b_count == 0

        v
      end
    end
def partition_mount_points(partitions)
      partitions.keys.sort do |a, b|
        a_count = a.count('/')
        b_count = b.count('/')

        if a_count > b_count
          v = 1
        else
          if a_count < b_count
            v = -1
          else
            if a.length == b.length
              v = a <=> b
            else
              v = a.length <=> b.length
            end
          end
        end

        # This forces having swap partition at the end of the disk
        v = 1 if a_count == 0
        v = -1 if b_count == 0

        v
      end
    end
Returns valid array of sorted mount points

 ['/', '/home'] => ['/', '/home']
 ['swap', '/', '/home'] => ['/', '/home', 'swap']
 ['swap', '/', '/home', '/boot'] => ['/', '/boot', '/home', 'swap']
 ['/tmp-eventlog', '/', '/ubrc', '/tmp-config'] => ['/', '/ubrc', '/tmp-config', '/tmp-eventlog']