3

I have a NAS drive that shares files on my local network. I attached the logical drive letter X on my Windows 7 computer to this sharing. I am thinking of purchasing additional hard drives and setting up a RAID1 system. However, one of my folders contains very big files which are easy to reproduce, so I would not like to waste money on storing two replicas of these files. On the other hand, it would be great to have them on the same logical drive, X, for simplicity. Do you think that this is feasible? How should I start with it?

z32a7ul
  • 149
  • 6
  • If you want multiple block abstractions be be on the same logical "drive" in windows for the sake of organization, you could mount these filesystems with different policies to empty folders instead of drive letters. – Spooler Nov 18 '16 at 12:21

5 Answers5

12

Raid is working on partitions (block devices) "under" the filesyetem. Raid has no job with folders or files on filesystem.

Ipor Sircer
  • 1,226
  • 7
  • 8
  • 3
    This is a lazy, and fairly incorrect answer. – SnakeDoc Nov 17 '16 at 16:31
  • 3
    @SnakeDoc While this answer does not address how to make RAID-backed and non-RAID-backed filesystems accessible under a single share, I fail to see which part(s) of these two simple sentences contains "fairly incorrect" information. – Lance U. Matthews Nov 18 '16 at 04:44
  • 2
    @BACON "Raid is working on partitions" this used to be true, but not anymore. Nowadays Raid is working on blocks (if not on bytes), especially on smarter designs. – kubanczyk Nov 18 '16 at 10:13
  • 1
    kubanczyk and SnakeDoc are correct. This answer is fairly lazy, as it first ignores the fact that different RAID policies can be applied to sets of partitions within a group of disks (effectively changing the policies of directories after their filesystems have been mounted). Secondly, it ignores advanced volume managers such as LVM and ZFS that are capable of applying allocation policies on a per-volume basis. Yes, raid works under the filesystem. That's not an answer to this question and is pedantically dismissive. – Spooler Nov 18 '16 at 12:22
8

Perfectly feasible nowadays.

You need to create two volumes, one RAID and one non-RAID. Mount the RAID volume as X:, mount the second other as X:\subfolder.

MSalters
  • 700
  • 5
  • 6
5

Yes, you can do this, depending on what your NAS allows to be configured.

Essentially you will create a new logical volume which is the abstraction of your RAID-ed hard drives (your NAS sees 1 drive even though there are multiple making up the RAID). You can then mount this logical volume on a specific directory - meaning any data put into that directory will live on that logical volume only (your raid setup).

Repeat for your non-raided logical volume(s) (mount on a different directory). Anything that goes into that directory would live only on that logical drive.

Ex:

(root)/
     |__> usr/
     |__> lib/
     |__> boot/
     |__> home/
     |__> NAS_data/
                  |__> raid_data/
                  |__> data/
SnakeDoc
  • 570
  • 7
  • 24
4

This is actually possible, but not with classical RAID. With ZFS you can have a stripe, then set multiple mountpoints. Set one to copies = 1, which means ZFS will always store all files on this mountpoint on two different devices, making it behave like RAID1. Then you can have a second mountpoint where you leave copies = 0, so files will only be stored once.

mzhaase
  • 3,798
  • 2
  • 20
  • 32
  • ZFS doesn't work that well on windows though. – Gerald Schneider Nov 17 '16 at 13:05
  • 3
    @GeraldSchneider OP is using a NAS, though. – mzhaase Nov 17 '16 at 13:05
  • Since when does ZFS support `copies=0`? At least ZoL 0.6.5.7 only supports the values 1, 2 and 3. Also, the copies attribute works *in addition to* any vdev redundancy. Quoting from the ZoL man page for zfs, the section on the `copies` attribute: *"These copies are in addition to any redundancy provided by the pool, for example, mirroring or RAID-Z. The copies are stored on different disks, if possible."* – user Nov 18 '16 at 09:22
  • @mzhaase OP is using an unspecified "NAS drive". – user Nov 18 '16 at 09:24
  • @MichaelKjörling *Since when does ZFS support `copies=0`?* That's the "write-only" setting. Great performance. ;-) – Andrew Henle Nov 18 '16 at 11:47
  • @AndrewHenle I tried creating a pool with /dev/null as the backing device. ZFS threw it back in my face with `cannot use '/dev/null': must be a block device or regular file`. – user Nov 18 '16 at 12:18
  • @MichaelKjörling It makes a blazingly fast tape backup target, though. 8^P – Spooler Nov 18 '16 at 12:25
  • @MichaelKjörling If you use a stripe it won't do any copies per default, thats what I meant. – mzhaase Nov 18 '16 at 16:49
  • @mzhaase If you use ZFS in a JBOD configuration, it will save one copy with no redundancy of any data stored and, if I'm not mistaken, two copies of directory entry metadata and one set of copies (I *suspect* one per überblock) per disk of pool metadata (that last is how a single disk can tell you the pool layout in a multi-vdev multi-disk pool, even if non-importably). If you set the `copies` attribute to a value greater than 1, *additional* copies of all will be stored, on separate disks if possible. `copies=0` plain doesn't make sense given the semantics of the `copies` attribute. – user Nov 19 '16 at 20:29
  • If you have some authoritative source claiming that any ZFS implementation uses the `copies` attribute as you claim, then *please*, do link to it. It would greatly improve your answer in that case. – user Nov 19 '16 at 21:17
1

If you're using Windows and your NAS has normal network shares, you can create a symbolic link to a share using mklink like so

mklink /d "C:\network shares\normal" "\\server\share_original\"

mklink /d "C:\network shares\raid1" "\\server\share_raid1\"

You then have two subfolders within C:\network shares that point to the different shares on the NAS.

mklink creates the final folder, so for the examples ensure that the normal/raid1 folders don't exist before running the command.