Mapping a HDD to Supplement Ubuntu SSD Storage
Mapping a HDD to Supplement Ubuntu SSD Storage
I've set up a VPS with a 20GB SSD and a 4TB HDD. The default image was placed on the SSD, but I need to expand the HDD space for my seedbox. I found many guides suggesting gparted, though using it remotely via SSH proved tricky. Each partitioning or mounting attempt would crash the server until I fixed the fstab entries. I'm also trying to piece together instructions from several tutorials without fully grasping them, which might have led to mistakes. I'm running Ubuntu 22 without a graphical interface. Any advice on configuring this would be greatly appreciated.
You can simply attach the drive at /home/user/torrents if needed. Usually I mount it at /mnt/torrentsDrive and configure your torrent client to use that location. Most programs offer an option to adjust the torrent path. Did you update the fstab file? It shouldn’t crash the server just by adding a new drive. If booting fails because of an incorrect entry, enable the nofail setting so it skips the boot process during mounting.
The simple manual mount command is to run sudo mount /dev/vdb1 /home/user/torrent. Adjust fstab if needed. No issues expected—just fix any errors and set it up properly. If the drive isn’t partitioned, use `parted` to create one. Open a terminal and type `parted /dev/sda` (replace with your disk name). Then run `mkpart` to make a new partition. For instance, to make a 500MB partition from the start, enter `mkpart primary ext4 1MiB 500MiB`. Chatgpt usually suggests formatting the drive first for successful mounting.
When only one partition is needed, you don’t have to split it. Simply install the filesystem directly onto the entire disk using mkfs.ext4 /dev/vdb. If you prefer to create a partition, fdisk offers a simpler interface than parted. The process would appear like this: fdisk /dev/vdb Welcome to fdisk (util-linux 2.39.3). Adjustments stay in memory until you choose to save them. Exercise caution with the write command. The device lacks a recognized partition table. A fresh DOS (MBR) label was created with identifier 0x80cf6341. For guidance (m for help): g This generated a new GPT disklabel (GUID: 325459C8-FFFC-4BF4-A818-287F20437035). For guidance (n for options): n Set partition number (1-128, default 1): 1 First sector (34-990, default 34): Last sector, +/-sectors or +/-size{K,M,G,T,P} (34-990, default 989): Created a new Linux filesystem partition of 478 KiB. For guidance (w for write): The partition table has been updated. Disk synchronization is in progress. Use 'g' to switch to GPT, 'n' to add a new partition, then type 'enter' three times to accept defaults (1, first sector, last sector*), followed by 'w' to apply changes. You now possess a vdb1 partition in /dev. You can immediately mount it at /home/user/torrents, though this step may require further work if you plan additional uses. Create a distinct mount directory for /dev/vdb<1> and run: mkdir -p /mnt/storage Mount the source at /mnt/storage. Use get its UUID with blkid|grep vdb to confirm: UUID="2221858b-be73-4aa8-8ec7-6f3ce1302ec6" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="0439cf1a-a878-4ff9-b01f-be37dee6cb57". Formatting a unique mount point for /dev/vdb<1> is recommended beforehand to avoid complications later. Once done, you can access the torrents folder by mounting it directly, but be aware that altering permissions and files may require additional steps afterward.