Skip to content
Permalink
e362aeef88
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 42 lines (36 sloc) 1.06 KB
#! /usr/bin/bash
# Input (environment):
#
# MXQ_JOBID : job ident
# MXQ_SIZE : size in GB
# MXQ_UID : uid
# Output:
#
# /dev/shm/mxqd/tmp/$JOBID mounted, space from /scratch/local2
tmpdir=/scratch/local2/mxqd/tmp
mntdir=/dev/shm/mxqd/mnt/job
filename=$tmpdir/$MXQ_JOBID.tmp
mountpoint=$mntdir/$MXQ_JOBID
umask 006
mkdir -p $tmpdir
mkdir -p $mntdir
status=1;
if fallocate -l ${MXQ_SIZE}G $filename; then
if loopdevice=$(losetup --find --show $filename); then
if mkfs.ext4 \
-q \
-m 0 \
-E nodiscard,mmp_update_interval=300,lazy_journal_init=1,root_owner=$MXQ_UID:0 \
-O '64bit,ext_attr,filetype,^has_journal,huge_file,inline_data,^mmp,^quota,sparse_super2' \
$loopdevice \
&& mkdir -p $mountpoint && mount -Odata=writeback,barrier=0 $loopdevice $mountpoint; then
rmdir $mountpoint/lost+found
status=0
fi
losetup -d $loopdevice
fi
rm $filename
else
test -e $filename && rm $filename
fi
exit $status