Skip to content

Yihaw

Have you ever let your file management structure suffer so badly that you are left with a hodge podge of USB devices even though you have a nice fancy ZFS pool running... Whats that idiom ' Do as I say, not as I do '.

Not looking forward to sorting this

sdk                           8:160  0 111.8G  0 disk
├─sdk1                        8:161  0    16M  0 part
└─sdk2                        8:162  0 111.8G  0 part
sdl                           8:176  0 465.7G  0 disk
└─sdl1                        8:177  0 465.7G  0 part
sdm                           8:192  0 931.5G  0 disk
└─sdm1                        8:193  0 931.5G  0 part
sdn                           8:208  1  57.9G  0 disk
├─sdn1                        8:209  1  57.8G  0 part
└─sdn2                        8:210  1    32M  0 part
sdo                           8:224  1  28.9G  0 disk
└─sdo1                        8:225  1  28.9G  0 part
sdp                           8:240  1  14.8G  0 disk
├─sdp1                        8:241  1   2.2G  0 part
└─sdp2                        8:242  1     3M  0 part
sdq                          65:0    1  14.9G  0 disk
└─sdq1                       65:1    1  14.9G  0 part
sdr                          65:16   1  14.9G  0 disk
└─sdr1                       65:17   1  14.9G  0 part
sds                          65:32   1  14.6G  0 disk
└─sds1                       65:33   1  14.6G  0 part
sdt                          65:48   1  14.6G  0 disk
├─sdt1                       65:49   1   200M  0 part
└─sdt2                       65:50   1  14.3G  0 part

The relevant partitions are as follows:

sdk2 sdl1 sdm1 sdn2 sdo1 sdp1 sdq1 sdr1 sds1 sdt2

_partition=(sdk2 sdl1 sdm1 sdn2 sdo1 sdp1 sdq1 sdr1 sds1 sdt2)

for i in "${_partition[@]}"; do
  echo "/dev/$i";
done

cd ~
mkdir -p data_wrangling/usb{0..9}

# ToDo
# Take the _partitions list and mount them on usb{0..9} in order
# cat /sys/block/sdr/sdr1/size

_gb=(1048576)
calc=$( expr 31258591 / $_gb )

echo -e "\n$calc\n"