Shell Script: install NVMe driver and format DUT on Ubuntu
turnoff_key_CapsLock.sh
#!/bin/bash
echo -------------------------------------------
echo SCRIPT: "$(basename "$0")"
echo -------------------------------------------
BASEDIR=$(cd "$(dirname "$0")"; pwd -P) # for normal file
echo $BASEDIR
rmmod dnvme
modprobe nvme
## reinstall NVMe driver
echo lsmod | grep nvme
echo $(lsblk)
sleep 5
echo $(lsblk)
## fdisk NVMe device
echo -e "o\nn\np\n1\n\n\nw" | fdisk /dev/nvme0n1
mkfs -t ext4 /dev/nvme0n1p1
mkdir -p /media/nvme
mount /dev/nvme0n1p1 /media/nvme
sleep 5
echo 'DONE...'
No comments:
Post a Comment