This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
miscscripts [2020/11/09 17:02] dwheele [List connected USB devices] |
miscscripts [2023/01/21 18:13] (current) dwheele [Partition and Format GPT] |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| # fdisk -l | # fdisk -l | ||
| + | |||
| + | ==== findmnt ==== | ||
| + | |||
| + | Detailed listing of mounts, mount points, and child directories. | ||
| + | |||
| + | > findmnt | ||
| + | |||
| ==== List USB drives, mounted and unmounted ==== | ==== List USB drives, mounted and unmounted ==== | ||
| Line 23: | Line 30: | ||
| $ usb-devices | $ usb-devices | ||
| + | ==== Look at label of drive ==== | ||
| + | |||
| + | # e2label / | ||
| + | | ||
| + | Change label | ||
| + | | ||
| + | # e2label /dev/sda1 Boot | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | From the /etc/fstab file: | ||
| + | |||
| + | # blkid | ||
| + | |||
| + | Use ' | ||
| + | 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 ==== | ==== dmesg - print or control the kernel ring buffer ==== | ||
| Line 35: | Line 60: | ||
| # mount /dev/sdc1 / | # mount /dev/sdc1 / | ||
| | | ||
| + | ==== Partition GPT with gdisk ==== | ||
| + | |||
| + | # gdisk /dev/sdc | ||
| + | | ||
| + | |||
| + | ==== Partition and Format GPT with PARTED ==== | ||
| + | |||
| + | 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/ | ||
| + | Partition Table: gpt | ||
| + | Disk Flags: | ||
| + | | ||
| + | Number | ||
| + | | ||
| + | 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 / | ||
| | | ||
| + | |||
| ==== Copy ISO to USB stick ==== | ==== Copy ISO to USB stick ==== | ||
| Line 41: | Line 100: | ||
| sudo dd if=/ | sudo dd if=/ | ||
| + | |||
| + | ==== Mount to NTFS Drive with permissions for specific user and group ==== | ||
| + | |||
| + | NTFS does not have Linux-compatible permissions, | ||
| + | |||
| + | mount -o uid=userid, | ||
| + | |||
| + | https:// | ||
| + | ===== 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 / | ||
| + | | ||
| + | ===== Remove empty directories ===== | ||
| + | |||
| + | find / | ||
| + | |||
| + | ===== Remove empty files ===== | ||
| + | |||
| + | find / | ||