User Tools

Site Tools


Sidebar

Dan's Wiki

DokuWiki Instructions (local) DokuWiki Manual
Site Checker (Orphans Wanted)

Edit Sidebar

miscscripts

This is an old revision of the document!


Misc. Scripts

Find out name of USB stick

 # fdisk -l

List USB drives, mounted and unmounted

 lsblk
 

Create mount point

 # mkdir /mnt/usb-drive 
 

List connected USB devices

 $ lsusb
 $ lsusb -v
 

More detailed version:

 $ usb-devices
 

Look at label of drive

  # e2label /dev/sda1 
  

Change label

  
  # e2label /dev/sda1 Boot
  

From the /etc/fstab file:

Use 'blkid' to print the universally unique identifier for a device; 
this may be used with UUID= as a more robust way to name devices that 
works even if disks are added and removed. See fstab(5).

dmesg - print or control the kernel ring buffer

This shows possible error messages from the drive mounting

  $ dmesg.

Mount USB drive to system

  # mount /dev/sdc1 /mnt/usb-drive/
  

Partition and Format GPT

  $ sudo parted /dev/sdd
  mklabel gpt
  
  (parted) print
  Model: ASMT 2105 (scsi)
  Disk /dev/sdd: 1000GB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt
  Disk Flags:
  
  Number  Start  End  Size  File system  Name  Flags
  
  mkpart primary 0% 100%
  (parted) quit
  

Create a Filesystem on the New Partition

  # mkfs.ext4 -L offsitebackup /dev/sdd1

Mount for Test Use

  # mount /dev/sdd1 /mnt/offsitebackup
  

Copy ISO to USB stick

rdfind

This compares directories of files and decides which files can be removed due to an algorithm.

-n Is a dry run mode only directory director - list of directories and files to compare. Items found first are the originals, and kept.

sudo rdfind -n true /var/nas/backup /var/archive/backup
miscscripts.1652328041.txt.gz · Last modified: 2022/05/12 04:00 by dwheele