1. Create and format a hard disk partition
1.1. View detected devices of class "DISK"
sudo lshw -C disk
1.2. View existing partition table(s)
sudo fdisk -l
1.3. Edit the partition table for my chosen device (in this case, "sdb")
sudo fdisk /dev/sdb
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x1c8c9d78.
- Type n and press Enter.
- Type p and press Enter.
- Type 1 and press Enter.
- Press Enter to accept the default first sector. 5.** Press Enter** to accept the default last sector.
- Type w and press Enter to write the changes to disk. You should now have a new partition called sdb1.
Display the new partition table:
sudo fdisk -l
/dev/sdb1 wird angezeigt
2. Format new partition as type ext4
2.1. Format the new partition
sudo mkfs -t ext4 /dev/sdb1
answer:
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 4194048 4k blocks and 1048576 inodes
Filesystem UUID: 8a1f9e47-da1f-49f1-999d-b742020d480e
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
2.2. Create a new directory where the new drive will mount into
sudo mkdir /catalogue-data
sudo mount /dev/sdb1 /catalogue-data
Folder /catalogue-data is the data path required by GeoNetwork configured via environment variables environment variables in jetty service
3. Auto-mount filesystem on server start
sudo nano /etc/fstab
add the following line:
# /etc/fstab: static file system information.
#
# 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).
#
# <file system> <mount point> <type> <options> <dump> <pass>
...
/dev/sdb1 /catalogue-data ext4 defaults 0 0