0

As far as I know, (most) file-systems do not support one to write into file-system cluster multiple times. In other words, cluster is the smallest unit in file-system and even if a single bit of information needs to be written, a new cluster needs to be used. However, is it similar with RAID chunk? Is it possible to append a file-system cluster into RAID chunk if RAID chunk is multiple times larger than a file-system cluster?

Drawing for explaining the question:

1 Answer 1

4

Your first statement is untrue for most file systems, though there are notable exceptions like ZFS, that indeed work in a Copy on Write mode.

(Edit: Reading it again, I am not sure I understood you first statement. Should you mean that a new piece of information, aka a new file, always require a complete new block, this is indeed true for most file systems, again with some exceptions as modern file systems like ZFS and btrfs are quite complex and use features like variable block sizes etc.).

RAIDs usually can't work in such a mode as they have no idea what sections of the array are free, so every write operation to a given logical block of the RAID device has to go to the same RAID chunk. Again, ZFS and similar file systems are different here because they are a combination of RAID and file system.

Final remark: SSDs always work in a Copy-On-Write mode because of how they work: Updating anything in a given block, even one bit, requires to erase the block and write it again and this erase operation is really slow. Instead, the SSD controller makes a new copy and erases the block when it's idle. If the SSD runs out of empty blocks for COW, SSDs become unusable slow.

2nd edit, responding to your edit/clarification:

It's important to understand that the Linux software RAID (or a hardware RAID for that matter) has no conception of files or a file system, it only deals with block devices and essentially maps blocks from a logical volume to blocks of physical media according to certain rules. If a RAID chunk is larger than the smallest file system allocation block, it's entirely possible that data from two or more files end up in this chunk, as all the RAID driver sees is a request to write a piece of data to a certain logical block which it will write out to physical media according to its rules, regardless of the content of this data. It has no way (and no need) to even determine if this piece of data is related to the other data in this chunk in any way. Needless to say, ZFS/btrfs work differently :)

2
  • In my first statement I indeed meant that if a new write operation occurs(e.g. new file is written to disk), then new cluster is required. And I meant traditional file systems like ext3 and ext4. I added a drawing to clarify my question.
    – Martin
    Mar 11, 2014 at 9:41
  • @Martin: See my 2nd edit.
    – Sven
    Mar 11, 2014 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .