Skip to content

Commit ee48ce2

Browse files
authored
Fallback to dd if fallocate failed. (#3782)
ZFS does not support it
1 parent 12404fb commit ee48ce2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ydb/deploy/local_binary/linux/start.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ elif [[ $1 = "disk" ]]; then
4242
echo Data file ydb.data not found, creating ...
4343
fallocate -l 80G ydb.data
4444
if [[ $? -ge 1 ]]; then
45-
if [ -f ydb.data ]; then
46-
rm ydb.data
45+
echo fallocate failed. Proably not supported by FS, trying to use dd ...
46+
dd if=/dev/zero of=ydb.data bs=1G count=0 seek=80
47+
if [[ $? -ge 1 ]]; then
48+
if [ -f ydb.data ]; then
49+
rm ydb.data
50+
fi
51+
echo Error creating data file
52+
exit
4753
fi
48-
echo Error creating data file
49-
exit
5054
fi
5155
need_init=1
5256
fi

0 commit comments

Comments
 (0)