diff --git a/changelog.md b/changelog.md index 417788553..68ce35d18 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v0.31.4](https://github.com/nextcloud/nextcloudpi/commit/ebd1fc1) (2017-09-30) nc-format-USB: speed up ext4 creation with lazy initialization +[v0.31.5](https://github.com/nextcloud/nextcloudpi/commit/7bca99d) (2017-09-30) nc-format-USB: fix format disks >2TB and more + +[v0.31.4](https://github.com/nextcloud/nextcloudpi/commit/cdf1822) (2017-09-30) nc-format-USB: speed up ext4 creation with lazy initialization [v0.31.3 ](https://github.com/nextcloud/nextcloudpi/commit/c2abfaa) (2017-09-30) letsencrypt: fix uppercase domains cert path (Closes #229) diff --git a/etc/nextcloudpi-config.d/nc-format-USB.sh b/etc/nextcloudpi-config.d/nc-format-USB.sh index 60baab899..861a5db4b 100644 --- a/etc/nextcloudpi-config.d/nc-format-USB.sh +++ b/etc/nextcloudpi-config.d/nc-format-USB.sh @@ -33,6 +33,9 @@ configure() return 1; } + # disable nc-automount if enabled + killall -STOP udiskie 2>/dev/null + # umount if mounted umount /media/USBdrive* &> /dev/null @@ -45,9 +48,14 @@ configure() local NAME=( $( lsblk -l -n | grep -v mmcblk | grep disk | awk '{ print $1 }' ) ) [[ ${#NAME[@]} != 1 ]] && { echo "unexpected error"; return 1; } - wipefs -a -f /dev/"$NAME" || return 1 - printf 'o\nn\np\n1\n\n\nw\n' | sudo fdisk /dev/"$NAME" || return 1 + wipefs -a -f /dev/"$NAME" || return 1 + parted /dev/"$NAME" --script -- mklabel gpt || return 2 + parted /dev/"$NAME" --script -- mkpart primary 0% 100% || return 3 + sleep 0.5 mkfs.ext4 -q -E lazy_itable_init=0,lazy_journal_init=0 -F /dev/"${NAME}1" -L "$LABEL_" + + # enable nc-automount if enabled + killall -CONT udiskie 2>/dev/null } install() { :; }