#!/bin/bash # this script mount the first partition on the COMPUSA usb harddrive" # last edited Sept 9, 2025 # partitions are: # sdb1 vfat 1024bytes sdb2 sdb3 # command history: # mkdir extstor # dmesg | tail -20 # sudo fdisk /dev/sdb # sudo mkfs.ext2 -b 1024 /dev/sdb1 # sudo mount /dev/sdb1 /mnt/extstor/ # sudo chown leo extstor # now user: leo can read and write to the partition # ------------------------------ # for the sdb1 partition formatted as w95 vfat the following command # must be used to mount this drive so that user 1000 (leo) can r&w files to # it. #--- working script as of 20250909 to mount sdb1 partition which will be used for the rsync backup # echo "" echo "Step 1. Mounting partion sdb1 --> type=vfat w95 32bit | bs = 1024 bytes" sudo mount -t vfat -o rw,user,uid=1000,gid=1000,dmask=011,fmask=111,blocksize=1024,fat=32 /dev/sdb1 /mnt/extstor echo "" echo " done ... mountpoint is /mnt/extstor" echo "" echo "" echo "**************** Begin rsync operation *****************" echo "" cd /mnt/extstor sudo rsync -a /home/leo/ /mnt/extstor/ echo "" echo " rsync operation is completed " echo "" ls -l echo "" echo "************* rsync script completed *************" echo "" # ************ end of file *****************