Comments on: ZFS Administration, Part X- Creating Filesystems https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/ Linux. GNU. Freedom. Thu, 11 Jan 2018 12:06:15 +0000 hourly 1 https://wordpress.org/?v=5.0-alpha-42199 By: AS https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-270867 Sat, 01 Jul 2017 14:13:27 +0000 http://pthree.org/?p=2849#comment-270867 Hello, I'd like to use ZFS for my desktop / workstation box.

I is there a way to tell ZFS where to place a dataset on the disks in a pool? AFAIK reading and writing is faster on the outer parts than on inner parts of a disk.

There is a tool that arranges files in a sequential order so that data is accessed "in a row". That speeds up the boot process or other scenarios like starting X loading the binaries, fonts, desktop theme, icons….
There is a tool that does this but it only works for EXT* file systems. It's named e4rat http://e4rat.sourceforge.net/ . Years ago I used a tool on windows which did both.

I am almost sure that both is possible with ZFS. Am I wrong?
Is there anything speaking against positioning a DS on the disks and making ZFS store data in a sequential order?

]]>
By: Eric Pedersen https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-230138 Thu, 26 Mar 2015 20:20:36 +0000 http://pthree.org/?p=2849#comment-230138 I think you can safely ignore my question, because I think I've figured it out.

]]>
By: Eric Pedersen https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-230131 Thu, 26 Mar 2015 17:59:09 +0000 http://pthree.org/?p=2849#comment-230131 This is a fantastic source of information that I should have read before doing something dumb!

I created a pool called /data and a dataset called /data in the same location. ie: 'zpool list' and 'zfs list' come back with 'data'. (That's me - worst practices...)

Now I've got a whack of backups sitting in /data. Is it to possible to a) create a new dataset called data/backup, b) move the stuff in data to data/backup, and c) do a 'zfs destroy data' without losing all my backups? Or should I even bother at this point?

]]>
By: Aaron Toponce https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-227903 Tue, 17 Feb 2015 20:40:20 +0000 http://pthree.org/?p=2849#comment-227903

"In this scenario, each logical volume is a fixed size in the volume group."

The LVs aren't even listed in the diagram and they're not fixed, they can be expanded (assuming the underlying filesystem can too). The bitch is shrinking the filesystem.

The LVs are listed in the digram (/usr, /var, /, /home). When referring to the logical volumes, I am referring to LVM2, not ZFS. Logical volumes in LVM are indeed fixed in size. If you have an LVM volume group of 2 TB, and you create a logical volume of 1 TB in size, then there is only 1 TB of volume group space left to create additional LVM logical volumes.

An advantage of being restrictive (i.e. using partition-like things) is that if your webserver gets DDoSed or something only your /var/log/web gets maxed out, not your whole system. Not having a limit with everyone pissing in the pool seems easy but, as you mention, causes fragmentation.

That is true. ZFS has dataset quotas that work well here, or ZVOLs of fixed size, if you would prefer to guard against that in this situation.

I assume you cover these caveats in the next chapters, especially with quotas and ZVOLs, but i haven't gotten there yet. 🙂 Don't get me wrong, i think ZFS is great. Keep it up.

No problem. I'll answer your questions as I come across them.

]]>
By: NM https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-227045 Thu, 05 Feb 2015 00:17:06 +0000 http://pthree.org/?p=2849#comment-227045 "In this scenario, each logical volume is a fixed size in the volume group."

The LVs aren't even listed in the diagram and they're not fixed, they can be expanded (assuming the underlying filesystem can too). The bitch is shrinking the filesystem.

An advantage of being restrictive (i.e. using partition-like things) is that if your webserver gets DDoSed or something only your /var/log/web gets maxed out, not your whole system.

Not having a limit with everyone pissing in the pool seems easy but, as you mention, causes fragmentation.

I assume you cover these caveats in the next chapters, especially with quotas and ZVOLs, but i haven't gotten there yet. 🙂

Don't get me wrong, i think ZFS is great. Keep it up.

]]>
By: Ildefonso Camargo https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-170803 Tue, 12 Aug 2014 16:41:58 +0000 http://pthree.org/?p=2849#comment-170803 "When that device fills, you must resize the logical volume and the filesystem together. This typically requires a myriad of commands, and it's tricky to get just right without losing data."

Sorry, but, I do this all the time, never lost data, and it is not tricky. Furthermore, it only requires two commands:

lvexpand
resize2fs

Now what *is* tricky is to *shrink* the filesystem, and there is real data-loss risk if you don't do it correctly. This is why almost everyone using LVM leaves "spare" disk space on the volume group, to allow for grow.

]]>
By: Roger Qiu https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-138769 Fri, 27 Jun 2014 08:02:10 +0000 http://pthree.org/?p=2849#comment-138769 Is there a way to set ARC sizes for specific datasets?

In some situations, some applications already have their own RAM cache, and so would it be possible to reduce ARC on a particular dataset or folder? That way we don't have double caching of the same data.

]]>
By: Tim Milstead https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-132064 Tue, 04 Mar 2014 16:16:36 +0000 http://pthree.org/?p=2849#comment-132064 Thanks for all your hard work putting this together. I have found it very useful.

I think I might have found a small typo. Should the line:

# umount /tank/test5

say:

# umount tank/test5

?

]]>
By: Ryan https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-129687 Sat, 21 Sep 2013 21:53:32 +0000 http://pthree.org/?p=2849#comment-129687 Looking at it again, I discovered that the directory I created and the files I copied over to "/tank" were actually created/copied to the root filesystem. So, the mount point /tank consisted of a mix of the ext4 root filesystem and the zfs datasets.

]]>
By: Ryan https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-129686 Sat, 21 Sep 2013 19:20:40 +0000 http://pthree.org/?p=2849#comment-129686 I continue to be amazed at how well zfs is laid out, but maybe a little shocked at how little protection it has from keeping you from doing something stupid. Prior to committing to zfs, I did a little bit of experimenting.

I was a little uneasy about how instantaneous a "zpool destroy tank" command is. But looking into it a little more, you can recover with "zpool import -Df". Good. Not sure if it's something to be relied on, but I don't expect to be playing with the zpool command much after the initial setup.

I created a zpool and a dataset "tank/Backup". The dataset is mounted at /tank/Backup, and everything was great. I copied a file to /tank/Backup, then deleted it. I don't know why, but I went to the /tank directory and did a "rmdir Backup". Backup then disappeared. I would have thought it would complain and prohibit this, but it removed it as would happen with any other directory. I rebooted to see if it zfs would automatically create a mount point for the dataset, but that didn't happen. I then re-created the mount point (mkdir /tank/Backup), or so I thought. When I copy a gigabyte sized file into that directory, "zfs list" still shows the size as 272K. That file is still there, and I can modify or delete it, but it doesn't show up in the dataset size or even in the total for the zpool. When I reboot the system after doing all of this, all of these files are still there. So where are those files? It seems like they're in the zpool, just not officially. This all seems like a thing to avoid, and something to be aware of.

So, if I could create a mount point by just going to the pool mount point "/tank", what else could I do? I tried copying a file to "/tank" and it was successful. But "/tank" isn't a dataset, so where is the file actually? Again, I don't intend to do these things, but what are the consequences if it's done by accident?

]]>
By: Aaron Toponce https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-129302 Wed, 07 Aug 2013 16:13:06 +0000 http://pthree.org/?p=2849#comment-129302 Correct. Every dataset is available of used blocks. Free blocks are defined as those that are not used. So, when a dataset frees blocks back to the pool, the other datasets are aware of that change.

]]>
By: Ryan https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-128650 Fri, 26 Jul 2013 05:10:55 +0000 http://pthree.org/?p=2849#comment-128650 Each dataset has full access to the pool and takes the space it needs when writing files to the dataset. Does the opposite apply as well? That is, when erasing files in a dataset, is the space returned to the pool?

]]>
By: Warren Downs https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-127206 Mon, 01 Jul 2013 22:17:40 +0000 http://pthree.org/?p=2849#comment-127206 ZFS sharing the pool seems like it could be at least partially emulated by using bind mounts on a traditional Linux system. Great feature but not really unique, in that sense...

]]>
By: Aaron Toponce : ZFS Administration, Appendix A- Visualizing The ZFS Intent LOG (ZIL) https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-124833 Fri, 19 Apr 2013 11:09:26 +0000 http://pthree.org/?p=2849#comment-124833 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part IV- The Adjustable Replacement Cache https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-124810 Fri, 19 Apr 2013 10:56:33 +0000 http://pthree.org/?p=2849#comment-124810 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-124485 Wed, 20 Mar 2013 18:37:50 +0000 http://pthree.org/?p=2849#comment-124485 Fxed! Thanks!

]]>
By: Michael https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-124483 Wed, 20 Mar 2013 18:09:45 +0000 http://pthree.org/?p=2849#comment-124483 Great articles. I may have found a minor typo you may want to fix (unless I read it wrong)... In the part X post I think "my" should be "by" or "by my"... My brain filled it in as "by" and I almost missed the typo... For reference, the portion I am referring to is "... how do the filesystems get mounted? This is done my importing the pool, ..."

Thanks again !!!

]]>
By: Aaron Toponce : ZFS Administration, Part XVII- Best Practices and Caveats https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-122626 Thu, 03 Jan 2013 13:02:48 +0000 http://pthree.org/?p=2849#comment-122626 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part XVI- Getting and Setting Properties https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-122570 Wed, 02 Jan 2013 13:01:04 +0000 http://pthree.org/?p=2849#comment-122570 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part XV- iSCSI, NFS and Samba https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-122449 Mon, 31 Dec 2012 13:01:35 +0000 http://pthree.org/?p=2849#comment-122449 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part XIV- ZVOLS https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-122058 Fri, 21 Dec 2012 13:01:03 +0000 http://pthree.org/?p=2849#comment-122058 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part XIII- Sending and Receiving Filesystems https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-122019 Thu, 20 Dec 2012 13:01:05 +0000 http://pthree.org/?p=2849#comment-122019 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part IX- Copy-on-write https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-121901 Tue, 18 Dec 2012 19:35:38 +0000 http://pthree.org/?p=2849#comment-121901 [...] Creating Filesystems [...]

]]>
By: Aaron Toponce : ZFS Administration, Part XI- Compression and Deduplication https://pthree.org/2012/12/17/zfs-administration-part-x-creating-filesystems/#comment-121881 Tue, 18 Dec 2012 13:01:41 +0000 http://pthree.org/?p=2849#comment-121881 [...] Creating Filesystems [...]

]]>