Getting PARTUUID and mounting disks in linux

Scenario: modifying /etc/fstab to automatically mount devices (disks) on startup.

Process is, find the PARTUUID (reference to the partition) and add details of where you want this mounted to the /etc/fstab file.


Using a command link with no window manager, it's harder to cut and paste. So I have found how to use the linux commands to pipe output into other files, and in particular when you need to "sudo" before each fle. 


Enter the "tee" command. Help from:

https://www.scaler.com/topics/linux-append-to-file/


sudo blkid  (this one gives you the PARTUUID)


then pipe to 

sudo tee -a /etc/fstab (this one appends to the file)


so altogether it looks like this 

sudo blkid | sudo tee -a /etc/fstab



Then to test that line in fstab it without needing to rebook:


sudo mount  /mnt/point

(where /mnt/point is the location you've put in fstab to mount the device)


A response of 

mount: (hint) your fstab has been modified...

suggests it went ok. now cd to the mount point to double check.

Comments

Popular posts from this blog

Getting networking going with new Archlinux installation

Partitioning using command line and parted

Raspberry PI fun with a second hand B+... setting up wifi