User Tools

Site Tools


miscscripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
miscscripts [2022/02/14 01:31]
dwheele [Copy ISO to USB stick]
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 /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).
  
 ==== dmesg - print or control the kernel ring buffer ==== ==== dmesg - print or control the kernel ring buffer ====
Line 35: Line 60:
     # mount /dev/sdc1 /mnt/usb-drive/     # mount /dev/sdc1 /mnt/usb-drive/
          
-==== 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 56: Line 88:
  
     # mkfs.ext4 -L offsitebackup /dev/sdd1     # mkfs.ext4 -L offsitebackup /dev/sdd1
 +
  
 ==== Mount for Test Use ==== ==== Mount for Test Use ====
Line 68: Line 101:
    sudo dd if=/path/to.iso of=/dev/sdb bs=16M    sudo dd if=/path/to.iso of=/dev/sdb bs=16M
  
 +==== Mount to NTFS Drive with permissions for specific user and group ====
  
 +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
 ===== rdfind ===== ===== rdfind =====
  
Line 78: Line 117:
   sudo rdfind -n true /var/nas/backup /var/archive/backup   sudo rdfind -n true /var/nas/backup /var/archive/backup
      
-  +===== Remove empty directories ===== 
 + 
 +  find /path/to/dir -empty -type d -delete 
 + 
 +===== Remove empty files ===== 
 + 
 +  find /path/to/dir -empty -type f -delete 
 + 
miscscripts.1644802293.txt.gz · Last modified: 2022/02/14 01:31 by dwheele