# fdisk -l
Detailed listing of mounts, mount points, and child directories.
> findmnt
lsblk
# mkdir /mnt/usb-drive
$ lsusb $ lsusb -v
More detailed version:
$ usb-devices
# e2label /dev/sda1
Change label
# e2label /dev/sda1 Boot
From the /etc/fstab file:
# blkid
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).
This shows possible error messages from the drive mounting
$ dmesg.
# mount /dev/sdc1 /mnt/usb-drive/
# gdisk /dev/sdc
This is somewhat difficult to use because the mkpart command sometimes gives alignment errors.
$ 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
# mkfs.ext4 -L offsitebackup /dev/sdd1
# mount /dev/sdd1 /mnt/offsitebackup
Reference: http://askubuntu.com/questions/116942/any-way-to-manually-make-a-bootable-usb-from-iso
sudo dd if=/path/to.iso of=/dev/sdb bs=16M
NTFS does not have Linux-compatible permissions, so when you mount with a normal NTFS connection, you have wide-open permissions. To make the NTFS drive look like it has a specific owner and group, use something like this:
mount -o uid=userid,gid=groupid,dmask=022,fmask=133 /path/to/disk /mnt
https://unix.stackexchange.com/questions/604674/chmod-is-not-working-on-ntfs-3g-partition
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
find /path/to/dir -empty -type d -delete
find /path/to/dir -empty -type f -delete