Blame view

scripts/list_ntfs.sh 311 Bytes
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

# Outputs, separated by newlines, the list of NTFS volumes present on this computer

for disk in $(cat /proc/partitions  | awk -F " " '{print $NF}' | tail -n+3); do
    HEADER=$(dd if="/dev/$disk" bs=1 skip=3 count=4 2> /dev/null)
    if [[ $HEADER == "NTFS" ]]; then
        echo $disk
    fi
done