1

I have a web server working very well which currently is using one hard disk of 2TB, but this same server have another 2TB hard disk without any function so i want to partionate it in order to merge them to make 4TB memory space on my server, is there a way to do something like this? I'm using Ubuntu Server 18 with webmin and virtualmin.

enter image description here

I'm really noob in linux doing this kind of things, so i'll really appreciate you tell me step by step an example in order to get my goal.

Thanks

Fernando Torres
  • 115
  • 3
  • 13
  • 3
    you need to use lvm and create a logical volume. – c4f4t0r Feb 02 '20 at 22:21
  • I agree with c4f4t0r, here are more detailed instructions answered in another post in: [AskUbuntu](https://askubuntu.com/questions/219881/how-can-i-create-one-logical-volume-over-two-disks-using-lvm) – SysadminB Feb 05 '20 at 08:38

1 Answers1

2

You can create either a software RAID, or an LVM logical volume spanning two disks. Notice that by simply aggregating the disks, you also aggregate the chances of failure: once your disks are grouped in a virtual 4 TB drive, if either of these fails you'll lose everything.

From your lsblk output, we see that your sdb drive is in use (as the system drive). Therefore you can't aggregate it to the other drive: you can only aggregate unused disks or partitions.

So your only option is to partition your /dev/sda, make a filesystem on it, and mount it somewhere like /mnt. All of this is easily done in Webmin from the "disk partition" tool in the "Hardware" subsection. Here is the way to do it from the command line:

# create the partition table (GPT)
sudo parted /dev/sda mklabel gpt

#create a partition spanning the whole disk
sudo parted /dev/sda mkpart 1 ext4 1 -1

#create a filesystem on the new partition
sudo mkfs.ext4 /dev/sda1

#create a mountpoint
sudo mkdir /mnt/disk

#mount the disk
sudo mount /dev/sda1 /mnt/disk

#edit /etc/fstab and add a line like this
/dev/sda1 /mnt/disk ext4 defaults 0 0
wazoox
  • 6,918
  • 4
  • 31
  • 63