diskman.sh: implemented mkext4.sh

This commit is contained in:
2022-02-18 09:22:59 +01:00
parent 074518c513
commit 9667da892f

View File

@@ -13,7 +13,7 @@
# Blank the given disks
blank_disk()
{
if [[ $(test -b /dev/$1) ]]; then
if [[ -b /dev/$1 ]]; then
prnt I "Wipping $1 drive signature (a backup is made in /root)..."
wipefs --force --all --backup /dev/$1
prnt I "Filling beginning of $1 drive with zeroes..."
@@ -66,6 +66,7 @@ mkparts()
if [[ -n $1 ]]; then
# For each given size we make a partition
for $part in $@; do
# If size is zero we interpret it as all available space
if [[ $part == 0 ]]; then
echo ",,L" >> $tmpfile
else
@@ -87,13 +88,21 @@ mkparts()
}
# ------------------------------------------------------------------------------
conf_ext4()
# Format drive using ext4 filesystem, parameters will be a list of block device
mkext4()
{
: # Todo
for drv in $@; then
if [[ -b /dev/$drv ]]; then
mkfs.ext4 /dev/$drv
else
prnt E "/dev/$drv is not a bloc device!"
die 18
fi
done
}
# ------------------------------------------------------------------------------
conf_xfs()
mkxfs()
{
: # todo
}