format disks to xfs and mount it
14678
def _prepare_disks(self, disks_name):
        """"""
        fstab = '/etc/fstab'
        for disk in tqdm(disks_name.split(',')):
            sudo('umount /dev/{0}'.format(disk), warn_only=True)
            if sudo('mkfs.xfs -f /dev/{0}'.format(disk), warn_only=True).failed:
                sudo('apt-get update')
                sudo('apt-get -y install xfsprogs')
                sudo('mkfs.xfs -f /dev/{0}'.format(disk))
            sudo('mkdir -p /srv/node/{0}'.format(disk))
            files.append(
                fstab, '/dev/{0} /srv/node/{1} xfs noatime,nodiratime,nobarrier,logbufs=8 0 2'.format(disk, disk), use_sudo=True)
            sudo('mount /srv/node/{0}'.format(disk))
1211672
def mount(dev, mountpoint, flags='', log=None):
    ''''''
    ensureDirectory(mountpoint)
    systemCall('mount %s %s %s' % (flags, dev, mountpoint),
               log=log)
1169708
def mounts():
    '''
    
    '''
    cmd = 'mount'
    ret = {}
    out = __salt__['cmd.run_all'](cmd)

    output = out['stdout'].splitlines()
    for line in output:
        if not line:
            continue
        if 'fuse.mfs' in line:
            comps = line.split(' ')
            info1 = comps[0].split(':')
            info2 = info1[1].split('/')
            ret[comps[2]] = {
                'remote': {
                    'master': info1[0],
                    'port': info2[0],
                    'subfolder': '/' + info2[1],
                },
                'local': comps[2],
                'options': (comps[5].replace('(', '').replace(')', '')
                            .split(',')),
            }
    return ret
66612
def fsroot(self):
        """"""
        if self.osname == 'windows':
            return '{}:\\'.format(
                self._handler.inspect_get_drive_mappings(self._root)[0][0])
        else:
            return self._handler.inspect_get_mountpoints(self._root)[0][0]
844664
def _xfs_estimate_output(out):
    '''
    
    '''
    spc = re.compile(r"\s+")
    data = {}
    for line in [l for l in out.split("\n") if l.strip()][1:]:
        directory, bsize, blocks, megabytes, logsize = spc.sub(" ", line).split(" ")
        data[directory] = {
            'block _size': bsize,
            'blocks': blocks,
            'megabytes': megabytes,
            'logsize': logsize,
        }

    return data
504686
def _mount(device):
    '''
    
    '''
    dest = tempfile.mkdtemp()
    res = __states__['mount.mounted'](dest, device=device, fstype='btrfs',
                                      opts='subvol=/', persist=False)
    if not res['result']:
        log.error('Cannot mount device %s in %s', device, dest)
        _umount(dest)
        return None
    return dest
1004192
function & mock_mount(array $fs, $mountpoint = '~/approot') {
		$mountpoint = str_replace('~', $this->mock_homedir, trim($mountpoint, '/'));
		$normalizedfs = $this->mock_normalize($fs);
		$path = & $this->mock_ensurepath($mountpoint);

		$this->mock_fsmerge($path, $normalizedfs);

		return $path;
	}
810503
def init_volumes(self, single=None, only_mount=None, skip_mount=None, swallow_exceptions=True):
        """"""

        for disk in self.disks:
            logger.info("Mounting volumes in {0}".format(disk))
            for volume in disk.init_volumes(single, only_mount, skip_mount, swallow_exceptions=swallow_exceptions):
                yield volume
1300185
def put(self, src, dst):
        '''
        '''
        src = "%s%s" % (self._testfiles_path, src)
        return self._getStdOutCmd([self._hadoop_cmd, 'fs', '-put', src, self._full_hdfs_path(dst)], True)
96998
def mount(device, mountpoint, options=None, persist=False, filesystem="ext3"):
    """"""
    cmd_args = ['mount']
    if options is not None:
        cmd_args.extend(['-o', options])
    cmd_args.extend([device, mountpoint])
    try:
        subprocess.check_output(cmd_args)
    except subprocess.CalledProcessError as e:
        log('Error mounting {} at {}\n{}'.format(device, mountpoint, e.output))
        return False

    if persist:
        return fstab_add(device, mountpoint, filesystem, options=options)
    return True
17580
def make_image(opts={})
      opts = {:volume       => '/',
              :size         => 6000,
              :destination  => '/mnt/bundle',
              :exclude      => nil
              }.merge(opts)
      image_file = File.join(opts[:destination], opts[:prefix] )
      cmds = ["mkdir -p #{opts[:destination]}"]
      cmds << "dd if=/dev/zero of=#{image_file} bs=1M count=#{opts[:size]}"
      cmds << "mkfs.ext3 -F -j #{image_file}"
      cmds << "mkdir -p #{opts[:destination]}/loop"
      cmds << "mount -o loop #{image_file} #{opts[:destination]}/loop"
      cmds << "rsync -ax #{rsync_excludes(opts[:exclude])} #{opts[:volume]}/ #{opts[:destination]}/loop/"
      cmds << "if [[ -f /etc/init.d/ec2-ssh-host-key-gen ]]; then chmod u+x /etc/init.d/ec2-ssh-host-key-gen ;fi"
      cmds << "umount #{opts[:destination]}/loop"
      self.ssh cmds
      image_file
    end
103656
def to_disk
      mkdir
      @hash.each do |key, value|
        File.open(filename(key), 'w') { |file| file.write(value.to_yaml) }
      end
    end
1336731
def use_propsfs(self, folder=None, front=False):
        
        if folder is None:
            folder = "/%s/props" % ("Volumes" if platform.system().lower() == "darwin" else "mnt")
        self.add(PropsfsProvider(folder), front=front)
604089
def mount(self, readonly=True):
        
        self._handler.add_drive_opts(self.disk_path, readonly=True)
        self._handler.launch()

        for mountpoint, device in self._inspect_disk():
            if readonly:
                self._handler.mount_ro(device, mountpoint)
            else:
                self._handler.mount(device, mountpoint)

        if self._handler.inspect_get_type(self._root) == 'windows':
            self.path = self._windows_path
        else:
            self.path = posix_path
533925
def mount(name,volumes):
    '''
    
    '''
    for vol in volumes:
        try:
            out, err = subprocess.Popen(["VBoxManage","sharedfolder","add",name,"--name",vol["volume"],"--hostpath",vol["hostpath"]],
                                        stdout=PIPE,stderr=PIPE).communicate()
        except Exception as e:
            utils.error(e)
            return False
    return True
471805
public function getMounts()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Mounted file systems');
        }

        $volumes = array();

        if (version_compare($this->windows_version,'6.1.0000')>0) {
            $object = $this->wmi->ExecQuery('SELECT Automount, BootVolume, Compressed, IndexingEnabled, Label, Caption, FileSystem, Capacity, FreeSpace, DriveType FROM Win32_Volume');
        } else {
            $object = $this->wmi->ExecQuery('SELECT Compressed, Name, FileSystem, Size, FreeSpace, DriveType FROM Win32_LogicalDisk');
        }

        foreach ($object as $volume) {
            $options = array();
            if (version_compare($this->windows_version,'6.1.0000')>0) {
                if ($volume->Automount) {
                    $options[] = 'automount';
                }
                if ($volume->BootVolume) {
                    $options[] = 'boot';
                }
                if ($volume->IndexingEnabled) {
                    $options[] = 'indexed';
                }
            }
            if ($volume->Compressed) {
                $options[] = 'compressed';
            }
            $capacity = (version_compare($this->windows_version,'6.1.0000')>0) ? $volume->Capacity : $volume->Size;
            $label = (version_compare($this->windows_version,'6.1.0000')>0) ? $volume->Label : $volume->Name;
            $mount = (version_compare($this->windows_version,'6.1.0000')>0) ? $volume->Caption : $label.'\\';
            $a = array(
                'device' => false,
                'label' => $label,
                'devtype' => '',
                'mount' => $mount,
                'type' => $volume->FileSystem,
                'size' => $capacity,
                'used' => $capacity - $volume->FreeSpace,
                'free' => $volume->FreeSpace,
                'free_percent' => 0,
                'used_percent' => 0,
                'options' => $options,
            );

            switch ($volume->DriveType) {
                case 2:
                    $a['devtype'] = 'Removable drive';
                    break;
                case 3:
                    $a['devtype'] = 'Fixed drive';
                    break;
                case 4:
                    $a['devtype'] = 'Remote drive';
                    break;
                case 5:
                    $a['devtype'] = 'CD-ROM';
                    break;
                case 6:
                    $a['devtype'] = 'RAM disk';
                    break;
                default:
                    $a['devtype'] = 'Unknown';
                    break;
            }

            if ($capacity != 0) {
                $a['free_percent'] = round($volume->FreeSpace / $capacity, 2) * 100;
                $a['used_percent'] = round(($capacity - $volume->FreeSpace) / $capacity, 2) * 100;
            }

            $volumes[] = $a;
        }

        usort($volumes, array('Linfo\OS\Windows', 'compare_mounts'));

        return $volumes;
    }
10856
def mount_volume(volume, device='/dev/xvdf', mountpoint='/mnt/data', fstype='ext4'):
    '''
    
    '''
    _ec2().attach_volume(volume, _host_node()['id'], device)
    time.sleep(1)
    sudo('mkdir -p "%s"' % mountpoint)
    sudo('mount -t "%s" "%s" "%s"' % (fstype, device, mountpoint))