Thursday, March 18, 2021

Hantek 6022BL USB Oscilloscope: OpenHantek+PulseView vs. Hantek


Hi there. About one and a half years ago, I bought myself a Hantek 6022BL USB oscilloscope. Until today, I was using Hantek's own software in Windows and I was not very happy with it. As it can be seen from my previous article, I recently reinstalled my computer and in the meantime, I had the chance to check alternatives of Hantek. I tested and reviewed OpenHantek as oscilloscope software as well as PulseView as logic analyzer software. In this article, I will explain how to install device drivers and will compare these programs. Last but not least, this will also be like a note to myself for driver installation.

Hantek 6022BL combines a two-channel USB oscilloscope with a 16-channel logic analyzer. With its 20 MHz bandwidth and 48 MS/s sampling rate, it meets the needs of an  average electronics hobbyist. With respect to its properties, it is obviously not a professional bench-top model. It was attractive to me just because it is small and cheap.

Since USB oscilloscopes are available, there has been a constant debate about their usefulness. Many forums are divided between USB supporters and benchtop'ers similar to Android vs. iOS debate. To be honest, there are much better quality USB oscilloscopes than Hantek. For example, Picotech produces very high quality devices but their 2205A MSO model which has comparable features to Hantek, costs 4 times more. By the way, Hantek devices don't have USB isolation according to an Amazon review. This means, if the probe accidentally touches any high voltage source, it will be conducted to mainboard. Picotech models (AFAIK all of them) and some Owon models have isolated inputs. In my opinion, USB oscilloscopes are serious competitors to benchtop models due to their relatively low prices but this is limited to entry level. And nobody would invest in an USB oscilloscope for a high end lab grade device.

Setting this device up on Fedora is really piece of cake. Therefore, I will start with configuring the device on Fedora. There is a button on the back of the oscilloscope where USB connectors are. First of all, this button needs to be pressed (position H). In this position, USB ID of oscilloscope becomes 04B4:602A.


From my understanding, the USBXI port (above) is a modified USB port, maybe proprietary design, and allows to cascade multiple devices. In other words, using USBXI, it is possible to cascade connect two Hantek 6022BLs in order to use it as a four channel oscilloscope or 32 channel logic analyzer.

A Y-shaped cable, shown in the next image, comes with the oscilloscope. Two inputs allow, current can be drawn from both ports when current from single port is not enough. I also connected the oscilloscope with a standard B-type USB cable (with two ends) without problem. The red plug is just for power, has no data pins. It can be connected to an USB adapter, too.

Hantek did not develop a linux version of its software. OpenHantek is a really good alternative for linux because it is in Fedora standard repository, which means a simple sudo dnf install openhantek command is enough to install it. Likewise, its deb file is in standard Ubuntu repo, which means Ubuntu and Mint users wouldn't have any problem to install it. Even though OpenHantek is open source, I haven't tried to compile it.

If the oscilloscope is connected to the computer, oscilloscope windows opens immediately, when OpenHantek is started. Otherwise, a window appears first to the user to select a compatible device to acquire signals. I have attached a screenshot of the oscilloscope interface, below:


Many standard oscilloscope features are available on the user interface. For the screenshot, I set the calibration signal to 1 kHz and attached it to the first oscilloscope channel. I have connected an external signal generator to the second channel and chose the trigger as the first channel. When I put the markers on onto two consecutive leading edges of the square wave, the frequency can be accurately read as 1 kHz/div at the top of the screen. The dark blue line on the bottom is Fourier (spectral) analysis of the sine wave. Tiny harmonics at 6 and 8 kHz are clearly visible. The screenshot below, shows a Lissajous curve created with a simple RC circuit:


Signal histogram can be added from the left pane and the zoom button on the left pane allows zooming 2x2 divisions in the middle in a separate window. There are addition, subtraction and multiplication operations in math mode and finally, signal values can be exported as .csv file.

Since OpenHantek doesn't support logic analyzer, sigrok's PulseView (PV) needs to be installed separately. Actually, PV can also visualize analog signals but it does not have many options like OpenHantek. The installation of PV is relatively easy. Rpm packages for Fedora can be downloaded from Downloads page. PV is open source, too. I tried to compile it but gave up later, because it took longer than I expected. Following packages are prerequisites for PV: libzip, qt5-qtbase, qt5-qtbase-gui, boost-serialization, qt5-qtsvg. Fedora 33 do not only have boost-serialization installed. Once prerequisites are installed, the software packages must be installed with the same order as they appear on Downloads page. But careful: Some links contain more than one rpm. They can be installed using following snippet:

sudo dnf install libzip qt5-qtbase  qt5-qtbase-gui  boost-serialization  qt5-qtsvg

sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/libserialport/0.1.1/9.fc33/x86_64/libserialport-0.1.1-9.fc33.x86_64.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/libsigrok/0.5.2/4.fc33/x86_64/libsigrok-0.5.2-4.fc33.x86_64.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/libsigrokdecode/0.5.3/6.fc33/x86_64/libsigrokdecode-0.5.3-6.fc33.x86_64.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/sigrok-cli/0.7.1/5.fc33/x86_64/sigrok-cli-0.7.1-5.fc33.x86_64.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/libsigrok/0.5.2/4.fc33/x86_64/libsigrok-cxx-0.5.2-4.fc33.x86_64.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/sigrok-firmware/0.1.0/16.20151211gitb2daf81.fc33/noarch/sigrok-firmware-filesystem-0.1.0-16.20151211gitb2daf81.fc33.noarch.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/sigrok-firmware-fx2lafw/0.1.7/3.fc33/noarch/sigrok-firmware-fx2lafw-0.1.7-3.fc33.noarch.rpm
sudo rpm -ivh  https://kojipkgs.fedoraproject.org//packages/pulseview/0.4.2/4.fc33/x86_64/pulseview-0.4.2-4.fc33.x86_64.rpm

PV runs when the button is in P (not pressed) position. First, the device must be disconnected, otherwise the button has no effect. USB ID does not change on the fly. VID/PID of the device becomes 0925:3881 when the button is in P position and it starts running with Saleae Logic chipset (or compatible). Like OpenHantek, PV automatically recognizes connected devices and selects appropriate driver. If it shows "<No Device>", just click on it and select "fx2lafw" driver. Although there is a "hantek-6xxx" driver on the list, since the button is in P position, it doesn't run with Hantek chipset anymore. This "hantek-6xxx" driver allows PV to run in oscilloscope mode as I mentioned previously, when the button is in H position. After selecting the correct driver, click "Scan for devices..." and "Saleae Logic with 8 channels" is detected. At this point, PV is a little disappointing because the driver supports only 8 channels (Source: Hantek 6022BL). I hope, this will be improved in the future. The best thing with PV is that it has a protocol decoder.

I had nothing handy to demonstrate with logic analyzer. I found an Arduino project developed by Z. X. Lee in internet. He tested Saleae's logic analyser in his own blog. In case the project is deleted in future, its .ino file can also be downloaded here. After uploading the file to Arduino and making the connections (Arduino pins 5..12), I set the sampling parameters to 24 MHz and 100M samples and start sampling by pressing "Run" at the top left. In the mean time, I press the green-yellow button on the rightmost and add a parallel protocol decoder.


With the dark blue "Marker" button, left to the device selection field, the intervals between signal transitions and the signal frequency can be measured. PV doesn't have much more than that. 


Now, I will explain how to configure these in Windows. First of all, I have two alternatives in Windows: Either I use OpenHantek+PV in Windows, too but in that case, I will never be able to use 16 channels of the logic analyzer. Or, I use Hantek's own software. By the way, this software doesn't have a special name. The name of its shortcut is "Hantek6022BL". So, I will mention it HOS (Hantek's Own Software) in the rest of the article, so that there is no confusion between the device and its software. I agree, this abbrevitation is not creative at all but Hantek had to be creative not me. Another interesting thing is, that OpenHantek and HOS use different USB device drivers. I cannot simply install and use both. Therefore, I decided to use HOS anyway because I can use others with my other machine whenever I want.

When using the oscilloscope with HOS, the button must be in H position. I checked this, connected it to my computer and installed Windows drivers from the CD that came shipped with the oscilloscope. I didn't have a problem at this step but if the drivers cannot be installed in Windows 10 because they are not signed, there is an unpleasant workaround.  By the way, "HT6022BL Software" file on Hantek's product page contains newer drivers than "HT6022BL Driver" file. As of February '21, the content on product CD is the same as "HT6022BL Software" file. After installing the device drivers, I ran the software installation on CD and started HOS after installation is finished.  To be honest, the interface gives the impression that it's very low quality compared to OpenHantek.

I clicked on 6022BE icon for oscilloscope interface and my personal opinion is that the interface is not useful at all.


The first thing is that the right panel is simpler than it has to be. The user needs to find correct button for the frequently used "markers". The only feature, I find useful is that "Auto" button above, which automatically adjusts appropriate voltage, trigger and time interval for incoming signal. There is A/B operation in math mode, additionally. I could not understand its Fourier analysis mode, only a single peak shown up at the left edge of the screen for a 2 kHz signal and it couldn't capture harmonics like OpenHantek did. How can I know, that peak corresponds to 2 kHz if I am measuring an unknown signal. Unlike OpenHantek, there is neither zoom nor histogram. When I press Ctrl+M, a measure panel shows up, which contains useful signal information (like max./min. voltage, peak to peak voltage, frequency etc.) but its design is still insufficient. For example, if this information from both channels were listed side by side, more data would fit in the window and it would be easier to compare.


Finally, I tried to show an error I found in the interface in the image above. Controls disappear on the right pane, when it is made narrow and made wide again without scrolling the pane to left.

So, I closed the oscilloscope interface and clicked 6022BL icon for logic analyzer. The program started sampling as soon as it was started, yet I had set neither the sampling rate nor the number of samples! As you can see, HOS is quite unsuccessful about usefulness.


I set sampling rate to 100K/sec from the right panel. However, sample length cannot be changed. This is unfortunately another imperfection of the program. I found out its reason long after I bought the device. On the page 66 of its manual, it is written "Buffer Size: Max. 1M Samples". The developers of HOS appearantly preferred to stop sampling when its buffer is full while PV constantly fetches buffered data and purges device buffer. Sampling is started with play like button on the top right. The fact that color of each channel is same reduces legibility and this color is not a setting that can be changed.

Well, why should we use HOS, if its so bad? Shortest answer is, I wouldn't be using it if I had only a Windows computer. As I explained above, I cannot use it with linux anyway. So I already have OpenHantek+PV installed on my linux machine and I keep HOS just as an alternative. I already checked OpenHantek on Windows as well. Now, my only concern is switching the drivers because as I mentioned before, OpenHantek and PV use WinUSB driver, whereas HOS uses the driver written by Hantek. There is no need to uninstall Hantek driver to switch to OpenHantek. An utility called zadig deactivates Hantek driver and installs WinUSB driver. Zadig comes bundled with Windows  installer of PV.   The usage of zadig is explained in OpenHantek's installation guide under "Windows USB Driver Install".

If I may explain briefly, I start zadig and select Hantek6022BL from the list above. If it is not in the list, "List All Devices" must be enabled under Options menu. I took the screenshot on the left from a machine which has WinUSB already installed, normally WinUSB will not appear in "Driver" field. After clicking "Install Driver" button, WinUSB gets installed but this process has to be repeated twice. After doing this, the oscilloscope gets listed under "Universal Serial Bus devices" in device manager. Both Zadig and PV need VC++2010 library to be installed, otherwise they return "MSVCR100.DLL not found" error.

 
Hantek Driver

 
 
WinUSB Driver

 

After that, OpenHantek runs fine in Windows. Actually, this process is not very complicated, the reverse is more complicated. When I previously tried to uninstall WinUSB drivers using zadig, I couldn't get HOS to run again. I had to uninstall Hantek drivers and reinstall them. If Hantek driver is installed and still actively used, the error message "UploadFirmware: Couldn't open device..." appears when running OpenHantek. Finally, the only way to run both programs on the same machine is to install a linux VM in Windows. Even though the opposite is also possible, it's not practical since OpenHantek can be installed in a live linux system (a VM without a disk) with a single command (Fedora or Mint).

What about other alternatives? I didn't know about other alternatives before. While doing some research for this article, I came across the article about six different oscilloscope software for Hantek. OpenHantek stands out in this comparison. I only had heard of Open6022 from these, but when I had downloaded it, it was a single zip file consisting of some messy C++ code and without any single compilation guide or documentation. I believe it is improved over time. From its screenshots for example, the inforation in "measure" window is listed side by side for each channel as I suggested for HOS. These software may also be worth a try.

Tuesday, February 16, 2021

UEFI Dual Boot: Fedora Linux and Windows on Same Disk


Hi there. I wouldn't ever imagine that one day I would write about dual boot until I encounter an ever unimaginable problem. People surely know what dual booting is, but to repeat briefly, dual booting is partitioning a disk into more than one partition and installing multiple OSes. Of course, only one OS can run at the same time.

In earlier times, when I have initially heard about Linux, we used to shrink disk partitions with FIPS and install linux on the partition we just created. After virtual machines became widespread, I began to use dual booting less often because it was more practical for me to run a second OS virtually. Moreover, after I started using SSD, I was worried about disk wear-out since an OS is always used less than another, but I never had a problem. After finally buying my second computer with a good price, dual boot was (almost) no longer required, until I had to install Windows 7 for some tests, recently. 

Dual boot is actually pretty easy. Almost any OS on separate partitions can be booted using a good boot loader. So far, everything looks easy but new computers require a few extra steps to install an OS under UEFI because a separate EFI boot partition needs to be created. In this article, my aim is to install two OSes while utilizing the disk in the most efficient way, I can. I have done this installation on my physical machine before, but since I don't want to reinstall everything, I will use a VM, this time.
 
The operating systems will be Fedora 33 and Win 7, but I also installed Win 10. The steps are pretty much the same anyway. I prefer to keep linux /boot directory, in a separate partition because I use LVM for linux. This is just a habit but not a must. Besides /boot, I will create one partition for each OS.

Additional reading:
Is a /boot partition necessary anymore?
Is a /boot partition always necessary?
What's your recommendation on drive partitioning ... ?

Having this said, as of Fedora 33, the default file system is now btrfs. At the end of this article, I wrote a section about btrfs. I will not use btrfs for this installation and explained the reasons at the end.


Creating the Virtual Machine
I used VMware Workstation v15.5 for virtualization (not sure if VirtualBox can run EFI properly). The VM must have at least two cores and more than 2 GB of RAM, otherwise weird errors might show up. In Vmware ESXi Lab article, I explained how to create a VM, so I will only mention the some steps.

I created the machine with "Custom (advanced)" option and selected "I will install the operating system later". Guest operating system will be Windows 7 x64. This enables UEFI option at "Firmware type" screen (next figure). In case UEFI option is greyed out here, open the .vmx file after the machine is created and change the line starting with firmware as firmware = "efi". If this line doesn't exist, add the whole statement, close vmware workstation window and reopen it. For Win10, "Windows 10 x64" must be selected. As far as I know, there is no 32-bit Win 10 (Edit: there is). I did not understand, why there are "Windows 10" and "Windows 10 x64" options in VMware.

I assigned two cores (or two sockets) as CPU and 3072 MB as RAM. 2 GB is minimum recommended for Win 7, as long as it does not exceed the physical memory available (blue triangle), the more memory the VM has, the more reliable it runs. Network connection will be NAT and IO controller "LSI Logic SAS". Even though Win 7 supports "LSI Logic", too, Win 10 does not (vmware doesn't allow you to select). The wizard recommends NVMe disk for Win 10 but since I don't know the impact on this configuration, I chose SCSI (btw. Fedora can be installed on NVMe disk). I created a 120 GB SCSI disk. I did not check "Allocate all disk space now" because I don't have that much free space on my physical disk. At this point, I completed the wizard and created the machine.


Partitioning the Disk
Partitioning is the first thing to give attention. I have the following options:
  1. KDE partition manager on Fedora KDE
  2. "disks" on Fedora Workstation or spins like Cinnamon (I couldn't manage to use this)
  3. gparted: This comes with ubuntu live. I can either start the VM with ubuntu or install gparted on Fedora using sudo dnf install gparted command.
  4. fdisk: fdisk comes with all linux distros and its current version can also create GPT partitions.
Since Fedora 32, KDE is running problematically in VM. Therefore, before booting the VM with KDE, 3D graphics acceleration must be turned off in VM display settings (Source: KDE spin issues in VMWare).

The problem with disk partitioning is that Windows setup wants to create an EFI partition by itself. Therefore, it is necessary to leave approx. 256 MB unpartitioned space on disk. 128 MB of this, is EFI partition. There is another 100 MB hidden partition created by the setup, supposedly used for temp files or as recovery partition. If only 128 MB is left, 100 MB of this will be used for EFI partition and the hidden partition will not be created. For Win 10 installation, a 100 MB EFI partition is created with a 16 MB hidden partition. So, leaving 128 MB for Win 10 is enough.

To partition the disk, I booted the VM with ubuntu and started gparted (using ubuntu is optional, check the third item above. I explained same procedure with KDE partition manager below). I made sure that the correct disk is selected at the top right (especially for physical machines). First, I created a 'gpt' type partition table by clicking Create Partition Table item under Device menu. Then I right-clicked on the gray rectangle representing the empty disk and clicked New afterwards. I gave 1024 as "New size" and created first partition.

I clicked New again and gave 41216 to "Free space following" and 256 to "Free space preceding" (after entering this value, "Free space following" will drop to 40960. For Win 10, the initial value should be 40960+128=41088). As file system, I selected "unformatted" from the bottom of the list and created the second partition. Finally, I created a NTFS partition in the remaining space. There will be an unallocated 1 MB at the end of the disk, this is normal. At this point, the partitions should look like this:


I pressed the green tick button and wrote the partitions to the disk. By the way, while creating the partitions, the order is important. For example, if I had created the third partition before the second, the third partition (40 GB) would be sda2 since it would be in the second entry on GPT, and the second partition (78.75 GB) would be sda3. It is quite confusing that the partitions are numbered according to their entries on GPT instead of their location on disk.

After partitioning, I created volume groups and logical volumes for linux. I run following commands on console:

sudo su -
pvcreate /dev/sda2
vgcreate vg_fedora /dev/sda2
lvcreate -L 30G -n lv_root vg_fedora
lvcreate -L 25G -n lv_home vg_fedora
lvcreate -L 2G  -n lv_swap vg_fedora
lvcreate -L 6G  -n lv_tmp  vg_fedora
lvcreate -L 10G -n lv_var  vg_fedora

I created this template for my own needs and left 5.75 GB free space in volume group intentionally, to assign in case it's needed in future. If I wanted to add all remaining free space to lv_var, I should run:

lvcreate -l 100%FREE -n lv_var vg_fedora

Same thing can be done using KDE partition manager: I boot the VM with Fedora KDE, start partition manager from Applications -> System -> KDE partition manager and select the disk to partition from the left pane. Then, I click "New Partition Table" button above and select "GPT". I create a 1024 MB partition first (like above), then the second partition with 256 MB of preceding unpartitioned space and followed by 40960 MB of unpartitioned space and finally, third NTFS partition in the remaining space.


Fully partitioned disk can be seen above. I press Apply to write this to disk and create logical volumes for linux with the commands in the box above.


Installing Operating System #1: Windows
The order of installation of OSes is the second important point to give attention. I haven't tried with Windows 10 but Win XP and Win 7 always overwrite existing boot loader. GRUB will be overwritten with Windows MBR code if linux is installed first. Therefore I have to start with installing Windows.

I booted the VM with Win 7 DVD. In the meantime, I disconnected from network. I suppose, it tries to connect to internet for updates during the installation, which takes time. For physical installation, image file can be written to USB stick with UNetbootin or UUI. Additionally, while installing Win 7 to bare metal, my IR mouse and keyboard, which are normally recognized by Win 7 successfully, caused setup to crash. Therefore, it is better to remove them before installation.


I completed the installation by selecting "Custom (Advanced)" at the "Type of installation" step and selecting the third partition at the disk selection step.


I won't go into details of steps such as username, password etc.

During Windows 10 installation, product key will be asked. I skipped this by pressing "I don't have a product key". Those, who are considering to buy a license, need to choose a suitable edition at next step. The editions ending with "N", don't contain some programs as per EU laws, but it's nearly impossible to find license for them. I chose Win 10 Pro, but it doesn't matter for me because in fact, I am just installing a temporary VM. Like Win 7 installation, "Custom Install" needs to be selected and the third partition will be the installation target.


And again, I will not go into details, as the rest are just personal settings.


Installing Operating System #2: Linux
Before everything, there is one thing to be careful about physical machines. Linux must be booted in 64-bit UEFI mode. How will this happen?

For example, GRUB menus in Fedora are a little different between 32 and 64-bit modes. If the menu is in color, it is IA32, if it's without color then it is x64 mode. 

  
UEFI x64
  
IA32 mode

When I plug the USB stick with Fedora into my computer and restart, this USB disk appears twice in BIOS boot options. The right option can be found by trying or opening EFI shell and running BOOTX64.EFI manually. In VMware, it always boots in to correct mode without doing anything.

As it can be seen from the images above, I prefer KDE. Once Fedora has booted, just click "Install to Hard Drive" for installation. The best thing with live distro setups is being able to run other programs in the background during installation and if you have more than one monitor, you can browse the Internet at the same time while installation is running on the other monitor. By the way, I had turned the network connection off before Windows installation. This time, I will turn it on. Otherwise, I will need to configure network manually after the installation.

Right after starting the installation, I chose language, time zone etc. The only important thing here is disk partitions. To configure disks, I clicked "Installation Destination" and selected "Custom" under "Storage Configuration". Then I assigned previously created /boot partition and other volumes to corresponding mount points.

1- I clicked sda1 under "Unknown" section, set /boot as mount point and ext4 as file system on the right pane. I then clicked "Reformat" and "Update Settings".


2- I clicked on "EFI System Partition" (sda2, 100 MB) disk, set /boot/efi as mount point and clicked "Update Settings". In this step, the disk must be added without turning "Reformat" option on. This is the last point to pay attention in this whole setup.  Otherwise, Windows has to be reinstalled. Whereas, Anaconda rarely allows a partition to be added without reformatting.

3- Other partitions are mounted to corresponding mount points. For this, "Reformat" is checked and the corresponding mount point is entered into the text box. File system depends on personal preference. I usually prefer ext4 for /var and xfs for the rest. I explained my opinions on Btrfs in a separate section at the end of the article. Following screenshot shows all disks and their mount points.


After setting up the disks and creating a user with admin rights, the installation begins. The installer recognizes existing Windows installation and adds it to GRUB menu automatically. Nice feature! When I installed Centos 7 last time, there was no such feature and I had to add Windows entry to grub.cfg manually.

After all steps are done and machine is restarted both OSes are ready to use.


Appendix: Btrfs
Since Fedora 33 provides btrfs as the default file system and I install Fedora to bare metal, I researched on btrfs a lot.

First of all, btrfs contains a lot of features compared to ext and xfs. A disk partition can be saved exactly as it is thanks to the snapshot feature. This is really handy. Since this feature isn't available in ext, it must be used in LVM volumes for snapshot. And thanks to the subvolumes, there is no need to partition the disk anymore with btrfs. This has another advantage: btrfs supports deduplication. Files are split in chunks and chunks with identical hashes are stored as single copy. Using the whole disk as a single btrfs partition increases deduplication ratio by expanding the file/data pool and it is still possible to manage individual directories by using subvolumes. Finally, it replaces RAID which is known with its restrictive nature on disk sizes and allows users to create storage groups with different sized disks. While this feature may not mean much for desktop users, it offers way more flexibility to storage admins.

On the other hand, RedHat removed btrfs support from the kernel about three years ago. At that time, SuSe was recommending btrfs, but I don't know their stance, now. I have thought, btrfs was not mature at that time but there are rumors that there may be commercial concerns behind RedHat's decision: Oracle allergy could be why...

I still think, btrfs is the future technology and it's way more stable now, but it is still too early to use it in production, even if RedHat had supported it. One reason for this is, that I had migrated to FAT32 as soon as it is available and I had not been able to find any proper data recovery program when I had lost some data. That's why, I still keep a distance from new file systems. Another reason is the burden of migrating existing data. By the way, Phoronix's tests will give an idea about its performance:

On desktop, I simply did not want to use btrfs because of my habits. In my personal computer, I am using a partitioning scheme similar to above. For me, it is a matter of efficiency due to the deduplication, when I continue to use this scheme with btrfs. According to Btrfs FAQ, using a single btrfs partition is recommended for write optimization but not deduplication. Free space calculation is also confusing with btrfs. For example, a forgotten snapshot can take up a significant amount of space or a 120 GB disk may contain files of 300 GB with deduplication and still have 40 GB free space. The last reason is that I know LVM commands well since I have been using them for years and I did not want to leave my comfort zone for btrfs.