mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
bug #777: Better options based on FS type. Patch contributed by Grzegorz Kocur
This commit is contained in:
parent
4ea2629a51
commit
201715c316
@ -38,12 +38,31 @@ FSTYPE=$1
|
||||
SIZE=$2
|
||||
ID=$3
|
||||
|
||||
# Specific options for different FS
|
||||
case "$FSTYPE" in
|
||||
"ext2"|"ext3"|"ext4"|"ntfs")
|
||||
OPTS="-F"
|
||||
;;
|
||||
|
||||
"reiserfs")
|
||||
OPTS="-f -q"
|
||||
;;
|
||||
|
||||
"jfs")
|
||||
OPTS="-q"
|
||||
;;
|
||||
*)
|
||||
OPTS=""
|
||||
;;
|
||||
esac
|
||||
|
||||
DST=`generate_image_path`
|
||||
|
||||
exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" \
|
||||
"Could not create image $DST"
|
||||
exec_and_log "$MKFS -t $FSTYPE -F $DST" \
|
||||
exec_and_log "$MKFS -t $FSTYPE $OPTS $DST" \
|
||||
"Unable to create filesystem $FSTYPE in $DST"
|
||||
|
||||
exec_and_log "chmod 0660 $DST"
|
||||
|
||||
echo "$DST"
|
||||
|
Loading…
x
Reference in New Issue
Block a user