This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
miscscripts [2022/05/11 00:43] 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 22: | Line 29: | ||
| $ usb-devices | $ usb-devices | ||
| + | |||
| + | ==== Look at label of drive ==== | ||
| + | |||
| + | # e2label / | ||
| + | | ||
| + | Change label | ||
| + | | ||
| + | # e2label /dev/sda1 Boot | ||
| + | | ||
| + | |||
| + | |||
| From the /etc/fstab file: | From the /etc/fstab file: | ||
| - | Use ' | + | |
| + | |||
| + | | ||
| + | | ||
| + | | ||
| ==== dmesg - print or control the kernel ring buffer ==== | ==== dmesg - print or control the kernel ring buffer ==== | ||
| Line 38: | Line 60: | ||
| # mount /dev/sdc1 / | # mount /dev/sdc1 / | ||
| | | ||
| - | ==== Partition and Format GPT ==== | + | ==== 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 | $ sudo parted /dev/sdd | ||
| Line 59: | Line 88: | ||
| # mkfs.ext4 -L offsitebackup /dev/sdd1 | # mkfs.ext4 -L offsitebackup /dev/sdd1 | ||
| + | |||
| ==== Mount for Test Use ==== | ==== Mount for Test Use ==== | ||
| Line 71: | Line 101: | ||
| 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 ===== | ===== rdfind ===== | ||
| Line 81: | Line 117: | ||
| sudo rdfind -n true / | sudo rdfind -n true / | ||
| | | ||
| - | | + | ===== Remove empty directories ===== |
| + | |||
| + | find / | ||
| + | |||
| + | ===== Remove empty files ===== | ||
| + | |||
| + | find / | ||
| + | |||