Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


Parted

14 Sep 2020 » linux
parted /dev/sd?

print

mklabel, mktable
gpt

mkpart 
name?
file system?
Start 1024
End 100%

quit

mkfs.xfs -f /dev/sdb1

mount -t xfs /dev/sd

ext4 lazy

https://serverfault.com/questions/413143/is-there-such-a-thing-as-a-quick-format-for-ext4

mkfs.ext4 -E lazy_itable_init=1 /dev/sdxN

dot

devbestalignment(){
    dev=$1
    optimal_io_size=$(cat /sys/block/$dev/queue/optimal_io_size)
    minimum_io_size=$(cat /sys/block/$dev/queue/minimum_io_size)
    alignment_offset=$(cat /sys/block/$dev/alignment_offset)
    physical_block_size=$(cat /sys/block/$dev/queue/physical_block_size)
    
    if [ "$2" == "-v" ]; then
        echo "optimal_io_size $optimal_io_size"
        echo "minimum_io_size $minimum_io_size"
        echo "alignment_offset $alignment_offset"
        echo "physical_block_size $physical_block_size"
    fi
    
    echo "($optimal_io_size+$alignment_offset)/$physical_block_size" | bc
}

script

unix.stackexchange.com/questions/200582/scripteable-gpt-partitions-using-parted

parted --script /dev/sde mklabel gpt mkpart primary 1024 100%

best alignment

https://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/

Related Posts