0

I am using an ubuntu 18.04 computer in which I want to have a single logical volume (seeing all my drives as a single unit) but also having at least 1 drive fault recovery.

I have this setup in order to store family fotos:

  • NAS SYNOLOGY with 4 TB raid 1
  • Desktop PC with bunch of discs used for backups.

Backups of the different folders of the NAS are made regularly to the PC at the different disks. However, this is a bad solution because I have to do partial backups of the NAS to different discs and in case of total NAS failure/steal I am left with a bunch of unorganized discs old disks.

I initially thought to create a LVM with all the discs in the computer. This would solve the issue of having to create partial backups. However,this solution increases the risk of data loss. As far as I am concerned if one of the discs of the LVM fails all the LVM is lost.

I then thought of creating a raid 1 with the heterogeneous discs I have but I have not being able to find a proper solution.

Current drives I have for the backups are: 2x640GB 3x1TB 1x3TB

The reason I want to have at least 1 disc redundancy is that some of the drives are a bit old and barely used.

Is there any program/partition (LVM/AUFS + RAID 1) scheme that would allow this 1 logic volume and 1 disc redundancy?

Note: I know buying new disc is the easy and safe solution but I want to use the spare drives as backup, I am trying to achieve a "as best as possible setup" with current owned HW.

Note: I have also read about the possibility to use AUFS and snapRaid, but have not been able to compute the total amount of space I will be left at the end.

  • How much usable storage do you require? As you're splitting the NAS over multiple disks, I presume more than the spare 3TB disk you already have? Is the NAS' 4TB disk open for use here? (I presume not) – Attie Jan 14 at 11:51
0

I would suggest to use all the 1 TB disks and two 1 TB partitions from the 3 TB disk as a RAID 6 (two disks redundancy) and another raid with 500G partitions and put 2 again in the 3 TB one (making it a RAID 6 as well) and use the remaining 140g on each disk a a RAID 1, then merge everything with LVM. This way, you use all of it and will survive 1 physical disk failure.

Summarising:

RAID 6 (#1) :

  • 1 TB disk

  • 1 TB disk

  • 1 TB disk
  • 1 TB partition from 3 TB disk
  • 1 TB partition from 3 TB disk

RAID 6 (#2):

  • 500G partition from 640G disk A

  • 500G partition from 640G disk B

  • 500G partition from 3 TB disk
  • 500G partition from 3 TB disk

RAID 1 (#3)

  • 140G partition from 640G disk A

  • 140G partition from 640G disk B

Join everything with LVM

| improve this answer | |
  • Using two partitions of the same disk for redundancy is not a good idea - for performance it's also a bad idea. The 3TB disk in your scheme will see much more wear (due to seeking back and forth), and if it were to die, you've immediately lost the benefit of the RAID 6. – Attie Jan 14 at 11:54
  • It's not ideal due to asymmetry, but it will use all the disks, and OP looked for 1 disk redundancy. This is the best I can come up with with those constraints. Also parity is distributed evenly between volumes, so it should wear the same even if it was a single 2 TB partition. – Imanol Barba Sabariego Jan 14 at 12:54
  • As far as I understand with the proposed RAID 6 I have a two partition parity.Therefore I have two disc parity of the smaller one die or one disc if the big drive dies. Will give it a try. – Ricard Molins Jan 20 at 22:16
1

It is basic math, that with single-disk redundancy the size of the biggest disk must be the basis for redundancy.

If you want to store just family phots, the performance (especially latency) is of no concern, so we can chose even between bad performing solutions, so youcould

  • either go with RAID1 and combine the 3x1TB with 3 partitions of 1TB each on the 4TB disk and the two 640G disks together
  • or go with RAID5 and create a RAID5 from the two 640G disks and a 640G partition on the 3TB disk and another RAID5 with the three 1TB disks and a 1TB partition on the 3TB disk. You can use the remains of the big disk as scratch space

In both cases you would use these MD RAIDs as PVs for LVM and can so combine the whole space into a single LV

| improve this answer | |
1

If you're set on using your existing disks, then I'd probably propose that you:

  • 2x 640 GB disks - concatenated into a single 1280 GB volume (using LVM)
    • Use 1 TB for the array
    • The remaining 280 GB for whatever else
    • /dev/Xda and /dev/Xdb below
  • 3 TB disk
    • Use 1TB for the array
    • The remaining 2 TB for whatever else
    • /dev/Xdc below
  • 1TB disk
    • /dev/Xdd below
  • 1TB disk
    • /dev/Xde below
  • 1TB disk
    • /dev/Xdf below

This will allow you to produce a 4 TB ("RAID5" / 1 disk redundancy) or 3 TB ("RAID6" / 2 disk redundancy).

layout

I'd also suggest using something like ZFS that will deal with file consistency (many other filesystems do not), allowing detection and repair of otherwise silent and undetectable file corruption... it can and will occur (personal experience)... this could be especially important for relatively "important" things like family photos.

Setup would look something like this:

# setup LVM stripe over 2x 640 GB disks
pvcreate /dev/Xda
pvcreate /dev/Xdb
vgcreate ${vg_name} /dev/Xda /dev/Xdb
lvcreate --size 1TB --type striped ${vg_name} --name ${lv_name}

# make a 1TB partition on the 3TB disk, remove all others
sfdisk /dev/Xdc <<< "start=2048,size=+1T,type=0FC63DAF-8483-4772-8E79-3D69D8477DE4"

# make a ZFS raid Z2 filesystem on the stripe, 1TB partition, and 1TB disks
zpool create tank raidz2 /dev/${vg_name}/${lv_name} /dev/Xdc1 /dev/Xdd /dev/Xde /dev/Xdf

This should result in a ~5 TB ZFS pool, with ~3 TB available... use raidz1 instead to reduce from two parity disks to one, and get ~4 TB available.

Afterwards, you can go back and add another logical volume (lvcreate) to use remaining space on the 640 GB disks, and another partition on /dev/Xdc (fdisk) to use remaining space on the 3 TB disk.

If you wanted to, you can put a partition table on the 3x 1 TB disks, but it's not strictly necessary. You can also be a little more space efficient by tweaking the size of the logical volume and partition to better match the acutal size of the "1 TB disks".


If you do decide to use ZFS, make sure you run a scrupt (zpool scrub tank) approximately once per month - use a cronjob to automate it.

Also, I can't comment on the performance impact or "sense" of using LVM to combine the two disks that are then presented to ZFS.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.