Skip to content

Using 2nd Harddrive

PhysK edited this page Jan 22, 2020 · 1 revision

Table of Contents

  1. Intro
  2. Creating a file partition
  3. Create the secondary mount
  4. edit fstab
  5. Check your space
  6. tune2fs

1. Intro

Situation:

Have a 250GB SSD and a second 2TB hard drive? The problem that you'll run into with PlexGuide is that all of your stuff downloading and uploading will target your PRIMARY DRIVE (in this example, the 250GB SSD).

The following instructions will assist you in SETTING up your second hard drive.

To check, type df -h and if you notice your OTHER HD not there, you need to follow the steps below.


2. Creating a file partition

fdisk -l

Pay attention to the name of the new disk

type fdisk name-of-drive (mine was /dev/sdb)

m - print menu

if there is a valid partition, you can delete it with d

n - add new partition

p - to create a primary partition

1 - choose the number of partition (pick only 1)

Press enter twice

press w to write to disk and exit

create a file system

mkfs.ext4 /dev/sdb -- keep pushing enter until done


3. Create the secondary mount

Now we can create the folder for the secondary drive, the best options are this one.

mkdir /mnt && chown -cR 1000:1000 /mnt

in some systems is /mnt already created

4. edit fstab

What is fstab ??

short explain about fstab,

Fstab is your operating system’s file system table. In the old days, it was the primary way that the system mounted files automatically. Nowadays, you can plug in a USB drive of any kind and it’ll just pop up in Nautilus as it does in Windows and Mac OS, but once upon a time, you had to manually mount those disks to a specific folder using the “mount” command. This held true for DVDs, CDs, and even floppies (remember those?).

Back then, your only alternative was the tell the computer that anytime a specific device was plugged in, it should be automatically mounted in a specific place. This is where fstab came in, and it was awesome. Suppose you swapped hard disks on your IDE or SCSI controller. The computer could load the file systems in a different order, potentially messing things up. Fstab is configured to look for specific file systems and mount them automatically in the desired way each and every time, preventing a myriad of disasters from occurring.


type blkid

  • look for the name of the device you're looking for, mine was /dev/sdb

copy the uuid number

/dev/sdb: UUID=<<< TAKE YOUR NUMBER >>> TYPE="ext4"

type: nano /etc/fstab

Enter at the bottom of the file:

UUID=<<< TAKE YOUR NUMBER >>> /mnt ext4 defaults 0 0

(edit the UUID with the UUID of your hard drive you found earlier)

ctrl + x to save

type: sudo reboot or mount -a


5. Check your space

  • df -h

  • df -h /mnt

And now you can install PTS and all works ;-)

Don't do it after installing PTS it will break everything .


6. tune2fs

short explain

tune2fs command is one of the advanced Unix commands which allows you to adjust various tunable parameters of the ext2/ext3 filesystems. Naturally, it also helps you confirm the existing parameters configured for your filesystems.

Here's how we change the default reserve to be 6% of the overall filesystem size:

6% reserved SPACE

tune2fs -m 6 /dev/sdb
tune2fs 1.43.4 (31-Jan-2017)
Setting reserved blocks percentage to 6% 12226 blocks

And here we change it back. Note how the number of the block corresponding to 5% is exactly the figure we've seen earlier – 249036 blocks:

5% reserved SPACE

tune2fs -m 5 /dev/sdb
tune2fs 1.43.4 (31-Jan-2017)
Setting reserved blocks percentage to 5% 10188 blocks

for 100% using the drive USE this one

0% reserved SPACE

tune2fs -m 0 /dev/sdb
tune2fs 1.43.4 (31-Jan-2017)
Setting reserved blocks percentage to 0% 0 blocks

**Default block size for a filesystem**

If you ever want to confirm the block size of any filesystem, tune2fs will help you do just that:


tune2fs -l /dev/sda1 | grep Block
Block count:              203776
Block size:               1024
Blocks per group:         8192

From this example, you can see that the default block size for the filesystem on /dev/sda1 partition is 4096 bytes or 4k. That's the default block size for ext3 filesystem.


Useful Starter Links

  1. Introduction
  2. G-Suite Signup
  3. Recommended NewsHosts
  4. Change Log

Prior Planning 101

  1. Recommended Pre-Reading
  2. Server - Storage Planning
  3. Usenet or BitTorrent
  4. PTS Editions
  5. PTS Folder Structure
  6. PTS-Repos
  7. Common Issues

Deploy & Config

PTS-Team
  1. SSH Server Access
  2. Install PTS
  3. WatchTower
  4. Remote Path Mappings

Data Transport
  1. PTS Clone
    1. Google OAuth Keys
    2. PTS Move
    3. PTS Blitz
    4. 2nd HD Option

Key Components

  1. Traefik
  2. Port Guard
  3. PTS Shield
  4. PTS Press
  5. Google Cloud - GCE
    1. Automated setup
  6. Hetzner Cloud
  7. PTS Fork
  8. Extra PTS Commands

Blitz App Info

  1. Accessing PTS Apps
  2. App Port Scheme

Tools & Services

Core Apps [Expand]
  1. Emby
  2. Jackett
  3. Jellyfin
  4. LazyLibrarian
  5. Lidarr
  6. Netdata
  7. NZBGet
  8. Ombi
  9. Plex
  10. Portainer
  11. qBittorrent
  12. Radarr
  13. Radarr4k
  14. RadarrHDR
  15. RuTorrent
  16. SABnzbd
  17. Sonarr
  18. Sonarr4k
  19. SonarrHDR
  20. Tautulli
  21. JDownloader2
Community Apps [Expand]
  1. AirSonic
  2. Bazarr
  3. Bitwarden
  4. BookSonic
  5. cAdvisor
  6. Cloud Commander
  7. Deluge
  8. DelugeVPN
  9. Dozzle
  10. Duplicati
  11. Filebrowser
  12. FlexGet
  13. Gazee
  14. Headphones
  15. Heimdall
  16. HomeAssistant
  17. jd2-openvpn
  18. Kitana
  19. Logarr
  20. MakeMKV
  21. MariaDB
  22. McMyadmin
  23. MEDUSA
  24. Mellow
  25. Miniflux
  26. Monitorr
  27. Muximux
  28. Mylar
  29. NextCloud
  30. NowShowing
  31. NZBHydra2
  32. Organizr
  33. plpp
  34. pyLoad
  35. qBittorrent
  36. QBittorrent VPN
  37. radarrsyncarr
  38. Resilio
  39. rflood-openvpn
  40. rutorrent-openvpn
  41. Shoko Anime Server
  42. SpeedTest
  43. SyncLounge
  44. Teamspeak3
  45. The Lounge
  46. Transmission
  47. Trakt.or
  48. Ubooquity
  49. Varken
  50. vnc-xfce
  51. vnstat
  52. ZeroTier

Misc Info & Articles

  1. Change Server Time
  2. Fail2Ban
  3. Custom Containers
  4. Deploying Varken, Influx, Telegraf, Grafana
  5. cloneclean commands
  6. Understanding htop
Scripts
  1. Scripting Area
    1. Auto Upload for Sonarr and Lidarr
    2. Auto Delete Log
    3. Plex Plugin DB Backup
    4. Plex fast BACKUP
    5. Delete All Unmonitored from Radarr
Clone this wiki locally