Change drives and data location to ${SWIFT_DIR}/data
Chmouel Boudjnah authored on 2011/11/03 00:49:56... | ... |
@@ -274,9 +274,9 @@ GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$HOST_IP:9292} |
274 | 274 |
|
275 | 275 |
# SWIFT |
276 | 276 |
# ----- |
277 |
-# |
|
277 |
+ |
|
278 | 278 |
# Location of SWIFT drives |
279 |
-SWIFT_LOCATION=${SWIFT_LOCATION:-/srv} |
|
279 |
+SWIFT_LOCATION=${SWIFT_LOCATION:-${SWIFT_DIR}/data} |
|
280 | 280 |
|
281 | 281 |
# Size of the loopback disks |
282 | 282 |
SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-1000000} |
... | ... |
@@ -611,18 +611,21 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]];then |
611 | 611 |
s=${SWIFT_LOCATION}/drives/sdb1 # Shortcut variable |
612 | 612 |
|
613 | 613 |
# Create a loopback disk and format it with XFS. |
614 |
- if [[ ! -e ${SWIFT_LOCATION}/swift-disk ]];then |
|
615 |
- sudo touch ${SWIFT_LOCATION}/swift-disk |
|
616 |
- sudo chown $USER: ${SWIFT_LOCATION}/swift-disk |
|
614 |
+ if [[ ! -e ${SWIFT_LOCATION}/drives/images/swift.img ]];then |
|
615 |
+ mkdir -p ${SWIFT_LOCATION}/drives/images |
|
616 |
+ sudo touch ${SWIFT_LOCATION}/drives/images/swift.img |
|
617 |
+ sudo chown $USER: ${SWIFT_LOCATION}/drives/images/swift.img |
|
617 | 618 |
|
618 |
- dd if=/dev/zero of=${SWIFT_LOCATION}/swift-disk bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE} |
|
619 |
- mkfs.xfs -f -i size=1024 ${SWIFT_LOCATION}/swift-disk |
|
619 |
+ dd if=/dev/zero of=${SWIFT_LOCATION}/drives/images/swift.img \ |
|
620 |
+ bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE} |
|
621 |
+ mkfs.xfs -f -i size=1024 ${SWIFT_LOCATION}/drives/images/swift.img |
|
620 | 622 |
fi |
621 | 623 |
|
622 | 624 |
# Create and mount drives. |
623 | 625 |
mkdir -p ${s} |
624 | 626 |
if ! egrep -q "$s" /proc/mounts;then |
625 |
- sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8 ${s} |
|
627 |
+ sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8 \ |
|
628 |
+ ${SWIFT_LOCATION}/drives/images/swift.img ${s} |
|
626 | 629 |
fi |
627 | 630 |
|
628 | 631 |
for x in {1..4}; do sudo ln -sf $s/$x ${SWIFT_LOCATION}/$x; done |