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?
5 Answers
Raid is working on partitions (block devices) "under" the filesyetem. Raid has no job with folders or files on filesystem.
-
3
-
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. Nov 18, 2016 at 4: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. Nov 18, 2016 at 10:13
-
1kubanczyk 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.– SpoolerNov 18, 2016 at 12:22
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.
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/
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.
-
-
3
-
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 thecopies
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."– userNov 18, 2016 at 9:22 -
-
@MichaelKjörling Since when does ZFS support
copies=0
? That's the "write-only" setting. Great performance. ;-) Nov 18, 2016 at 11:47
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.