Файловая система zfs

Содержание:

Status of the ZPool Storage

Checking the size and usage of zpools: zpool list

This will display something like:

root@ubuntu:~# zpool list
NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
vol0  29.8G   230K  29.7G     0%  ONLINE  -

Checking health status for ZPools: zpool status

This will display something like:

root@ubuntu:~# zpool status
  pool: vol0
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        vol0        ONLINE       0     0     0
          raidz2    ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
        spares
          sde       AVAIL   

errors: No known data errors

Checking I/O statistics for ZPools: zpool iostat

This will display something like:

root@ubuntu:~# zpool iostat
               capacity     operations    bandwidth
pool         used  avail   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
vol0         230K  29.7G      0      0     10    431

More detailed view can be seen by adding the -v to the end of the zpool iostat.

root@ubuntu:~# zpool iostat -v
               capacity     operations    bandwidth
pool         used  avail   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
vol0         230K  29.7G      0      0     12    518
  raidz2     230K  29.7G      0      0     12    518
    sdb         -      -      0      1    274  3.41K
    sdc         -      -      0      1    174  3.41K
    sdd         -      -      0      0    274  3.41K
----------  -----  -----  -----  -----  -----  -----

OpenZFS Version

We updated from 19.10 to 20.04 LTS OpenZFS to its latest and greatest available release (0.8.3). As usual, those releases (0.8.2 and 0.8.3) bring a lot of improvements and fixes, (note though that we backported some fixes in Ubuntu 19.10 from 0.8.2 into our package to fix some critical issues for our users). We also backported in Ubuntu 20.04 LTS other fixes in our kernel from the incoming 0.8.4 (and OpenZFS 2.0) release, like encryption performance enhancements. ZSys and other components (for instance ZFS bindings) have been updated to work with the new libzfs version.

We also backported in Ubuntu 20.04 LTS other fixes in our kernel from the incoming 0.8.4 (and OpenZFS 2.0) release, like encryption performance enhancements. ZSys and other components (for instance ZFS bindings) have been updated to work with the new libzfs version.

Thanks to this, we are committed to deliver the best OpenZFS on Linux experience to our audience by continuing to fix any important issues that arise, and backporting any critical fixes from newer releases.

Manage ZFS pool in Ubuntu

We have seen how to create the different types of pools in Ubuntu and now we have a series of administrative options that we can perform in them.

How to view the status of Ubuntu ZFS poolsAs we saw previously we will be able to know the type of pool, involved devices and current state executing the following:

sudo zpool status

How to update a ZFS pool in UbuntuWhen we update ZFS, it will also be necessary to update your groupings, and each pool will warn of any update when we check its status. For this we will execute the following:

sudo zpool upgrade

Or we can update all the current pools by executing the following:

sudo zpool upgrade -a

How to add storage units to ZFS in Ubuntu

ZFS allows us to add new units to a pool at any time, for this we must indicate the name of the pool and the location of the unit in the following way:

sudo zpool add pool-solvetic /dev/sdf

How to remove a pool from Ubuntu ZFS

The moment we consider that we should not use a group of units anymore, we can proceed to eliminate it by executing the following:

sudo zpool destroy (pool_name)

We can check your status by running sudo zpool status:

As we can see, ZFS becomes a dynamic and powerful utility for the backup of information using RAID and thus always be sure of the integrity of the information.

ZSys is now installed by default

Some Ubuntu flavours already shipped it in 19.10, but ZSys has seen a number of changes and new capabilities. After a security review, it is now seeded by default on the Ubuntu desktop 20.04 LTS installation!

There are a lot of things to discuss around this component, in term of features and what it exactly brings to the user. Not only does this allow for system revert (and grub bootloader will now present them), but it is not limited to being a boot environment. In fact, there is so much to talk about that the next four blog posts focus on it alone.

The good news is that most of the features are completely working under the hood and transparent to the user. However, if you need to revert an upgrade, get back old files from a user, or are just interested in it, those posts should be of interest to you! This, the first in the series, is the only instalment that will appear on Ubuntu.com. For the next, head over to didrocks’ own blog.

Create a ZFS volume on Ubuntu

Category : How-to

Get Social!

ZFS is a disk and logical volume manager combining raid like functionality with guaranteeing data integrity. Every block of data read by ZFS is checksumed and recovered if an error is found. ZFS also periodically checks the entire file system for any silent corruption which may have occurred since the data was written.

ZFS was initially developed by Sun for use in Solaris and as such was not available on Linux distributions. Thanks to some clever guys over at ZFS on Linux, this has now changed. We can now install the ZFS on most Linux distributions such as Debain/ Ubuntu and Red Hat/ CentOS.

ZFS provides a data volume which can have multiple mount points, spanning multiple disks. Disks can be combined into virtual groups to allow for various redundancy options:

  • Mirror – data will be mirrored across disks, equivalent to RAID 1. This is quite simply a copy of one disk to another every time data is changed. You require a minimum of two disks for a mirrored set. This provides the best redundancy but requires the most space. For example, if you use 2x 500GB disks, only 500GB will be available as the other 500GB will be a copy of the first disk.
  • Stripe – data will be stored across all available disks, equivalent to RAID 0. In a two disk striped array, half of a file would be on disk one and half of the file on disk two. This provides the fastest read and write speeds but it offers no redundancy. In the event of a failed disk, all data on the stripe will be lost.
  • RAID-Z – data will be written to all but one of the disks, with the remaining disk used for parity. This is equivalent to RAID 5. A minimum of three disks are required with one disk always being used for parity. In the even of a single disk failure, all data can be recovered and in fact, will still be accessible providing no further disks fail. In the even of a second disk failure, all data on the RAIDZ will be lost.
  • RAID-Z 2 and RAID-Z 3 – these are the same as RAIDZ but with two and three disks used for parity respectively. RAID-Z 3 is recommended for highly critical data consistency environments. RAIDZ-2 requires a minimum of 4 disks, and RAID-Z 3 requires 5 disks as a minimum.

In addition to these virtual groups, multiple groups can be combined. For example, you can mirror a striped virtual volume to create a RAID 10. This gives the added performance of striped volumes with the redundancy of mirrored volumes.

For our below example, we are going to create a single RAIDZ 1 with three disks. This gives us two full disks of storage, and a further disk for parity.

Configure RAID0 with ZPOOL

This type of pool can be used with a single hard disk or if we have two or more hard drives. RAID0 will only take all the disks and will create a greater storage which, although it is useful, its main disadvantage is that if any of the disks fails the file system will be damaged.

If we want to create a pool of RAID0 we will execute the following:

sudo zpool create pool-solvetic /dev/sdb /dev/sdc -f

Note: The -f parameter is added to force the execution of the command.

As we can see, the command has been executed correctly. If we want to see the status of ZFS we will use the following line:

sudo zpool status

There we will see the name of the pool and the devices involved.

ZFS compression

As mentioned earlier, one can compress data automatically with ZFS. With the speed of modern CPUs this is a useful option as reduced data size means less data to physically read and write and hence faster I/O. ZFS offers a comprehensive range of compression methods. The default is lz4 (a high performance replacement of lzjb) that offers faster compression/decompression to lzjb and slightly higher compression too. One can change the compression level, e.g.

sudo zfs set compression=gzip-9 mypool

or even the compression type:

sudo zfs set compression=lz4 mypool

and check on the compression level using:

sudo zfs get compressratio

lz4 is significantly faster than the other options while still performing well; lz4 is the safest choice.

Data recovery, a simple example

Let’s assume we have a 2 x 2 mirror’d zpool:

$ sudo zpool create mypool mirror /dev/sdc /dev/sdd mirror /dev/sde /dev/sdf -f
$ sudo zpool status
  pool: mypool
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        mypool      ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
          mirror-1  ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0

Now populate it with some data and check sum the data:

$ dd if=/dev/urandom of=/mypool/random.dat bs=1M count=4096
$ md5sum /mypool/random.dat
f0ca5a6e2718b8c98c2e0fdabd83d943  /mypool/random.dat

Now we simulate catastrophic data loss by overwriting one of the VDEV devices with zeros:

$ sudo dd if=/dev/zero of=/dev/sde bs=1M count=8192

And now initiate a scrub:

$ sudo zpool scrub mypool

And check the status:

$ sudo zpool status
  pool: mypool
 state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-9P
  scan: scrub in progress since Tue May 12 17:34:53 2015
    244M scanned out of 1.91G at 61.0M/s, 0h0m to go
    115M repaired, 12.46% done
config:

        NAME        STATE     READ WRITE CKSUM
        mypool      ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
          mirror-1  ONLINE       0     0     0
            sde     ONLINE       0     0   948  (repairing)
            sdf     ONLINE       0     0     0

…now let us remove the drive from the pool:

$ sudo zpool detach mypool /dev/sde

..hot swap it out and add a new one back:

$ sudo zpool attach mypool /dev/sdf /dev/sde  -f

..and initiate a scrub to repair the 2 x 2 mirror:

$ sudo zpool scrub mypool

Как пользоваться ZFS

Настройка ZFS не очень сильно отличается от Btrfs, все базовые действия выполняются очень просто, вы сами в этом убедитесь.

Создание файловой системы

Сначала посмотрим есть ли уже созданные пулы ZFS. Для этого выполните такую команду:

Если вы устанавливаете эту файловую систему в первый раз, то здесь будет пустой список. Теперь создадим пул на основе существующего раздела, мы будем использовать раздел /dev/sda6

Хотя вы можете использовать не только раздел, а целый диск. Теперь смотрим еще раз список пулов:

Затем смотрим состояние нашего пула с помощью команды status, здесь выводится больше подробной информации. Если у вас есть несколько дисков, вы можете настроить RAID массив, чтобы данные хранились не на одном разделе, а синхронно копировались на несколько, это может в несколько раз увеличить производительность.

Обратите внимание, что диски должны иметь одинаковый раздел. Если вам не нужен RAID, вы можете настроить обычное зеркалирование на второй диск

Это увеличивает надежность хранения данных:

Теперь данные будут писаться на оба диска. Такую же вещь можно проделать с разделами, но здесь нет смысла, поскольку если жесткий диск накроется, то данные вы потеряете, а прироста производительности не увидите. Вы можете использовать даже файлы, для создания файловых систем.

Вы можете добавить новый жесткий диск или раздел к пулу:

Или удалить устройство из пула:

Чтобы удалить пул используйте команду destroy:

Для проверки раздела на ошибки используйте команду scrub:

Статистику использования пула можно посмотреть с помощью команды iostat:

Файловые системы ZFS

Теперь нужно создать файловые системы на только что созданном пуле. Создадим три файловые системы, data, files и media. Для этого используется команда zfs:

Файловые системы готовы, дальше рассмотрим монтирование zfs.

Монтирование ZFS

Точка монтирования для пула и для каждой созданной в нем файловой системы создается в корневом каталоге. Например, в нашем случае точки монтирования выглядят так:

Или можно использовать такую команду:

Чтобы размонтировать файловую систему для одного из созданных разделов используйте команду zfs umount:

Затем можно ее обратно примонтировать:

Параметры файловой системы

Кроме всего прочего, вы можете настроить различные параметры файловой системы ZFS, например, можно изменить точку монтирования или способ сжатия. Вы можете посмотреть все текущие параметры для файловой системы или пула с помощью команды:

Сначала включим сжатие:

Затем отключим проверку контрольных сумм:

Смотрим точку монтирования:

Затем установим свою:

Теперь раздел будет монтироваться в /mnt, настройки можно изменить для каждого из разделов.

Для настоящих знатоков извращений 🙂

Перед тем как реализовывать рекомендуется 7 раз подумать.

Q. Купить разом все хдд не имею возможности, а ухудшать конфиг не хочуA.

Q. А какими командами FreeBSD поделить 2T диск на половинки для этого?A.

Q. имею raidz1 на 2T дисках. Заменить каждый на 4T — ноль проблем. Но в выхлопе остается несколько шт 2T дисков. Печалька.A.

Q. Имею 2 диска, хочу raidz1 из трех дисков, но третий докупить потом — так можно? Вариант вопроса — имею зеркало, купил еще один диск, хочу превратить зеркало в raidz, других дисков нет — как?A. Можно и так извратиться используя фиктивный диск. До окончания процесса избыточности НЕ будет. Идея разыскана Archer13 и сохранена тут zfs on fake disk

Conclusion

Overall this guide should take 5-10 minutes. If you want a decently fast but simple network folder, this is the easy way to do it. We have a lot of excess hardware in our machine but suffice to say this is a fairly robust setup. For those wondering about all of the other hardware, we are likely going to use this box for another guide or two. The key point here is that the NVMe SSD will help provide speeds beyond 1Gb Ethernet. As we move forward, 10GbE and NVMe SSDs are going to become more commonplace yet hard drives will still continue to be the choice for mass storage. This guide should help you deploy a fairly high-end ZFS network share to store backups but would even be a good choice for commonly used files like ISOs. In terms of performance, once the cache got warmed up:

Ubuntu ZFS Transfer Speed no tuning

700MB/s+ transfer speeds were too much for a single SSD to write consistently so we had the share setup to sync write to two SSDs simultaneously on the Windows machine.

Rationale

Ubuntu server, and Linux servers in general compete with other Unixes and Microsoft Windows. ZFS is a killer-app for Solaris, as it allows straightforward administration of a pool of disks, while giving intelligent performance and data integrity.

ZFS does away with partitioning, EVMS, LVM, MD, etc. The available disks (of any size) are used to the best of their ability. Compression can be used to increase bandwidth. (q.v. Reiser 4, and cloop?)

ZFS is 128-bit, meaning it is very scalable. (e.g. 16 exabyte limit). Along with its record-setting scalability, it has a number of features that no other file system in production has:

  • State-of-the-art unsurpassed data reliability (including silent corruption detection and automatic data repair, if available) from end to end, thanks to transparent checksums in parent block pointers

  • Elimination of the RAID5 write hole that usually requires battery-powered disk technology or UPS technology to keep RAID arrays consistent in case of power failures
  • Online array reconstruction / reassemble, in a fraction of the time usually required to reconstruct an array, thanks to reconstruction dependent on contents rather than on disk topology
  • Online check (scrub) and online resilver of faulty, to verify and preserve the validity of on-disk data in the face of silent disk data corruption
  • Automatic deduplication and compression of data, selectable per volume or filesystem according to administrator policy

ZFS achieves its impressive performance through a number of techniques:

  • Dynamic striping across all devices to maximize throughput
  • Copy-on-write design makes most disk writes sequential
  • Multiple block sizes, automatically chosen to match workload
  • Explicit I/O priority with deadline scheduling
  • Globally optimal I/O sorting and aggregation
  • Multiple independent prefetch streams with automatic length and stride detection for maximum streaming performance
  • Unlimited, instantaneous read/write snapshots
  • Parallel, constant-time directory operations

Boot enhancements

With ZSys installed, building a boot grub menu sees some great enhancements. We basically divided by 4 the time to generate this menu, thanks to multiple profiling technics, which will make any operation needing to rebuild way more enjoyable.

Building the menu is something, but starting grub is another. With a number of state saves, you can rapidly hit the score of more than a hundred of them. Under those conditions, we saw performance degradation in navigating grub menus. In particular, displaying the first menu was taking 14s and navigating the history of state was taking more than 80s!

We made some drastic enhancements thereby making both of them instantaneous! And came up with multiple -hem- “””creative””” strategies for fixing that one (reducing from 7329 lines that grub didn’t really like to 728, each new history entry being 3 additional lines instead of 50 :p). We crafted all of this to still be readable for advanced users to edit the boot command line before starting a system.

Similarly, we were able to significantly speed up the boot time and make the systemd ZFS mount generator more robust. Basically, unless you revert to another system state, ZSys will be out of the way, not taking any additional time on the critical boot path. Also, if some pools to import are not in a coherent status, you will be dropped to system emergency state, asking you to fix this before booting. However, this should only be the case of a failing revert. Booting in the current, last known good state, should work. This is an area we will continue to work on, of course.

Finally, we fixed a bunch of issues on both grub and boot chainload that people testing ZFS on 19.10 reported to us, like external pools being systematically exported, some configurations issues and more. Thanks to everyone here, it helps to deliver a more solid experience with ZFS on Ubuntu 20.04 LTS!

Снапшоты Btrfs

Естественно, Btrfs поддерживает снапшоты — причем помимо обычных снапшотов доступны снапшоты с возможностью записи (более того, они и создаются по умолчанию). Для создания снапшотов используется следующая команда:

Подробнее о создании снапшотов, как ручном, так и автоматическом, можно прочитать в статье «Подушка безопасности», опубликованной в апрельском номере ][ за 2013 год. Здесь же я расскажу, как при наличии снапшота отследить, какие файлы изменились с момента его создания. Для этого в Btrfs есть так называемое поколение файлов. Возможность эта используется для внутренних целей, но есть команда, позволяющая смотреть список последних изменений — ею и воспользуемся. Сначала узнаем текущее поколение файлов:

Если такого поколения нет (в чем можно практически не сомневаться), выведется последнее. Теперь эту же самую команду выполним над снапшотом:

Если поколения будут отличаться, а они будут, то смотрим, какие же файлы изменялись со времени создания снапшота. В моем случае команда была следующей:

Список последних измененных файлов в BtrfsBtrfs: состояние свежесконвертированного массива RAID 10
 

NILFS2 — еще одна файловая система с поддержкой COW

Начиная с ядра 2.6.30 в Linux появилась поддержка еще одной ФС — NILFS2. Аббревиатура эта расшифровывается как new implementation of a log-structured file system. Основная особенность данной ФС заключается в том, что раз в несколько секунд в ней автоматически создаются чек-пойнты — примерный аналог снапшотов с одним отличием: спустя какое-то время они удаляются сборщиком мусора. Пользователь, тем не менее, может преобразовать как чек-пойнт в снапшот, в результате чего для сборщика мусора он становится невидимым, так и наоборот. Таким образом, NILFS2 можно рассматривать как своеобразную «Википедию», где фиксируются любые изменения. Из-за этой особенности — писать любые новые данные не поверх существующих, а в новые блоки — она прекрасно подходит для SSD-накопителей, где, как известно, перезапись данных не приветствуется.

Да, NILFS2 не настолько известна, как ZFS или Btrfs. Но в некоторых случаях ее применение будет более оправданным.

Заключение

Может быть, я покажусь субъективным, но ZFS, если ее сравнивать с Btrfs, выигрывает. Во-первых, некоторые возможности Btrfs до сих пор находятся в зачаточном состоянии, несмотря на то, что ей уже более пяти лет. Во-вторых, ZFS, при прочих равных условиях, более обкатана. И в-третьих, как просто инструментов для работы с ZFS, так и ее возможностей больше.

С другой стороны, как бы ни была хороша ZFS, по лицензионным соображениям она вряд ли когда-нибудь будет включена в mainline kernel. Так что, если не появится какой-нибудь еще конкурент, придется пользоваться Btrfs.

Facebook и Btrfs

В ноябре 2013 года лидер команды разработчиков Btrfs Крис Мейсон перешел на работу в Facebook. Это же сделал и Джозеф Бацик, мейнтейнер ветки btrfs-next. Они вошли в состав отдела компании, специализирующегося на низкоуровневых разработках, где и занимаются ныне ядром Linux — в частности, работают над Btrfs. Разработчики заявили также, что Facebook заинтересована в развитии Btrfs, так что причин волноваться у сообщества нет решительно никаких.

ZFS Snapshots

A ZFS snapshot is a read-only copy of ZFS file system or volume. It can be used to save the state of a ZFS file system at a point of time, and one can roll back to this state at a later date. One can even extract files from a snapshot and not need to perform a complete roll back.

In the following example, we snapshot the mypool/projects file system:

$ sudo zfs snapshot -r mypool/projects@snap1

..and we can see the collection of snapshots using:

$ sudo zfs list -t snapshot
NAME                     USED  AVAIL  REFER  MOUNTPOINT
mypool/projects@snap1   8.80G      -  8.80G  -

Now lets ‘accidentally’ destroy all the files and then roll back:

$ rm -rf /mypool/projects
$ sudo zfs rollback mypool/projects@snap1

One can remove a snapshot using the following:

$ sudo zfs destroy mypool/projects@snap1

Adding Aditional Storage to a ZPool

Adding a spare:

zpool add vol0 spare /dev/sde

This will add a spare drive to be used as a hot spare in event that one of the drives in the zpool fails.

root@ubuntu:~# zpool status -v
  pool: vol0
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        vol0        ONLINE       0     0     0
          raidz2    ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
        spares
          sde       AVAIL  

Addtional storage to a MIRROR, RAIDZ or RAIDZ2 ZPool:

Adding additional storage to a mirror, raidz or raidz2 zpool must be done in like raid groups.

Example:

If I have a 3 drive raidz2 zpool….

root@ubuntu:~# zpool status
  pool: vol0
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        vol0        ONLINE       0     0     0
          raidz2    ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0

errors: No known data errors

…additional storage must be added by introducing another 3 drive raidz2 raid group to the zpool.

zpool add vol0 raidz2 /dev/sde /dev/sdf /dev/sdg

So my vol0 zpool now looks like…

root@ubuntu:~# zpool status
  pool: vol0
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        vol0        ONLINE       0     0     0
          raidz2    ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
          raidz2    ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0
            sdg     ONLINE       0     0     0

errors: No known data errors

Same is true for zpool mirror and raidz sets.

Что там с ZFS?

На сегодняшний день ZFS остается самой продвинутой файловой системой, аналогов которой нет не только в мире Open Source, но и в среде коммерческого ПО. Она быстра, надежна, имеет богатый функционал и невероятно проста в администрировании. Изначально созданная компанией Sun Microsystems (привет Oracle) для операционной системы Solaris и анонсированная в 2005 году, она сразу стала лакомым кусочком для пользователей и разработчиков других операционных систем. Однако далеко не всем из них удалось почувствовать ее вкус.

Первыми претендентами на включение кода ZFS в свою ОС стали, конечно же, линуксоиды, готовые тащить в ядро все, что не привинчено болтами. Но судьба (роль которой, скорее всего, сыграла сама Sun) распорядилась иначе. Код ZFS, как и всей операционной системы OpenSolaris, оказался защищен лицензией CDDL, которая накладывает серьезные ограничения на его использование и, более того, совершенно несовместима с лицензией GPLv2, используемой ядром Linux. Фактически это означает, что есть только три пути включения ZFS в ядро: нелегальный, который включает в себя перенос ZFS без соблюдения закона об авторском праве, юмористический, при котором код Linux лицензируется под CDDL, и титанический, когда огромная кодовая база ZFS переписывается под GPL, да еще и с обходом Sun’овских патентов.

В общем — не комильфо, поэтому единственный способ задействовать ZFS в Linux — это использовать ее порт на fuse (http://zfs-fuse.net), страдающий багами и низкой производитель ностью, которая в силу архитектурных особенностей ZFS вряд ли сможет повыситься без переноса хотя бы части кода в ядро. Компания Apple также планировала внедрение ZFS в Mac OS X и даже успела выпустить экспериментальный драйвер и внедрить поддержку чтения ZFS в версию 10.5 Leopard, однако в октябре 2009 года проект закрыли без объяснения причин. Учитывая то, что лицензия BSD, покрывающая код ядра Mac OS X, позволяла без проблем перенести ZFS в ОС от Apple с минимальными затратами, такой поступок можно объяснить либо давлением со стороны Sun, либо глобальными изменениями в планах самой Apple.

В апреле 2007 года Павел Якуб Давидек закончил портирование ZFS в FreeBSD. На протяжении двух лет код был помечен как экспериментальный, но после исправления ряда проблем разработчик объявил о стабилизации порта, и 15 октября прошлого года FreeBSD стала первой ОС после Solaris, готовой к промышленной эксплуатации ZFS. По состоянию на 11 января 2010 года восьмая ветка FreeBSD полностью поддерживает zpool v14 (текущая версия ZFS в OpenSolaris: zpool v16).

Работа по поддержке ZFS велась и разработчиками NetBSD. В рамках проекта Google Summer of Code 2007 был представлен начальный (но неработающий) порт файловой системы. Работа по доведению кода до ума продолжилась как часть Summer of Code 2009, и в августе 2009 года поддержка ZFS была добавлена в репозиторий NetBSD.

Using clones

Creating a clone

A clone must be created from a snapshot using the command. We first pass in the snapshot name, followed by the clone name. For example, to create a clone called based on the snapshot, we run .

Replacing a filesystem with a clone

We can use the command to replace an active filesystem with a clone of the same filesystem. This will cause the original filesystem to become the clone of the filesystem. This also allows you to delete the filesystem from which a clone was created.

For example, say we created a snapshot of called , then we created a clone from that snapshot called . Running would swap (the original filesystem) with (the clone of the filesystem). This swaps the two, causing to become a clone of .

At this point you could rename the new filesystem and/or delete the old one to completely replace the original with the clone.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *