0

First of all I am a beginner. Yes I have researched several articles and done lots of reading about file systems. I am using ubuntu server 18.04. I did successfully download and use gparted and have a 3.64 Tib ext4 partition. I am now at the point where I want to mount the drive and tell it to mount on boot. The drive is going to store zoneminder files. (Yes I successfully installed and have zoneminder running with cameras displaying). I am frustrated because I am having trouble doing something that I think should be simple so I am asking for help please. How do i mount the drive and use it?

1 Answers1

0

First check the available disks and them sizes using for example lsblk

# lsblk 

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0   2,3M  1 loop /snap/gnome-calculator/180
loop1         7:1    0  12,2M  1 loop /snap/gnome-characters/69
loop2         7:2    0    13M  1 loop /snap/gnome-characters/103
loop3         7:3    0  86,9M  1 loop /snap/core/4917
loop4         7:4    0  86,6M  1 loop /snap/core/4486
loop5         7:5    0   1,6M  1 loop /snap/gnome-calculator/154
loop6         7:6    0  14,5M  1 loop /snap/gnome-logs/37
loop7         7:7    0   140M  1 loop /snap/gnome-3-26-1604/59
loop8         7:8    0   3,7M  1 loop /snap/gnome-system-monitor/51
loop9         7:9    0    21M  1 loop /snap/gnome-logs/25
loop10        7:10   0   3,3M  1 loop /snap/gnome-system-monitor/36
loop11        7:11   0 140,9M  1 loop /snap/gnome-3-26-1604/70
sda           8:0    1  29,8G  0 disk
└─sda1        8:1    1  29,8G  0 part
nvme0n1     259:0    0   477G  0 disk
├─nvme0n1p1 259:1    0   260M  0 part /boot/efi
├─nvme0n1p2 259:2    0    16M  0 part
├─nvme0n1p3 259:3    0  78,1G  0 part
├─nvme0n1p4 259:4    0   800M  0 part
└─nvme0n1p5 259:5    0 397,8G  0 part /

Next check UUID (this is universal identifier using to mount disk; device name can change if you attach another drives and reboot; UUID stays the same unless you don't format drive).

# lsblk -f    

NAME        FSTYPE   LABEL    UUID                                 MOUNTPOINT
loop0       squashfs                                               /snap/gnome-calculator/180
loop1       squashfs                                               /snap/gnome-characters/69
loop2       squashfs                                               /snap/gnome-characters/103
loop3       squashfs                                               /snap/core/4917
loop4       squashfs                                               /snap/core/4486
loop5       squashfs                                               /snap/gnome-calculator/154
loop6       squashfs                                               /snap/gnome-logs/37
loop7       squashfs                                               /snap/gnome-3-26-1604/59
loop8       squashfs                                               /snap/gnome-system-monitor/51
loop9       squashfs                                               /snap/gnome-logs/25
loop10      squashfs                                               /snap/gnome-system-monitor/36
loop11      squashfs                                               /snap/gnome-3-26-1604/70
sda
└─sda1      ext4              61447b22-3f5c-46a8-b933-48c84c33cd9e
nvme0n1
├─nvme0n1p1 vfat     SYSTEM   30F9-EC3E                            /boot/efi
├─nvme0n1p2
├─nvme0n1p3
├─nvme0n1p4 ntfs     RECOVERY 0A080BEE080BD819
└─nvme0n1p5 ext4              3cbe87ad-807d-45be-9565-d8f941c17b7e /

I choose /dev/sda1 (first partition on /dev/sda drive). First create mounting point, for example /data

sudo mkdir /data

To enable automounting parition you have to chanage /etc/fstab file. Append the line to that file:

UUID=61447b22-3f5c-46a8-b933-48c84c33cd9e  /data  ext4  defaults  0  2

One-liner to do that:

# echo -e "UUID=61447b22-3f5c-46a8-b933-48c84c33cd9e\t/data\text4\tdefaults\t0\t2" | \
    sudo tee -a /etc/fstab

And mount the drive with command: sudo mount /data

One-linear details

  1. echo -e - prints the line to stdout with changing \t to tab
  2. UUID=... - partition unique identifier
  3. /data - mount point of partition
  4. ext4 - filesystem on partition - in your situation may be diffrent
  5. defaults - mount options
  6. `The fifth field (fs_freq).

    This field is used by dump(8) to determine which filesystems need to be dumped. Defaults to zero (don't dump) if not present.

  7. The sixth field (fs_passno).

    This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be
    checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism avail‐ able in the hardware. Defaults to zero (don't fsck) if not present.

  8. | - Redirect standard output to standard input of next command

  9. sudo - make privilege escalation to root

  10. tee -a file append standard input to file