Is there a HDD/SSD emulator to learn and practice the cfdisk command?

Hello Friends

In January 2026 I would have the opportunity to install Void Linux in a 32 bits laptop. I already did do a research on YouTube about how to install it: where is mandatory do the disk format/partition and it is only possible manually. There is no a neither a GUI nor Terminal GUI. So far the best video I found is:

Where at 03:48 does mention about to commands as follows

  • cfdisk
  • fdisk

And is chose the cfdisk command

Now, I always use GParted but in Void Linux seems is mandatory use a command

Question

  • Is there a HDD/SSD emulator to learn and practice the cfdisk command? or fdisk?

How did you learn to use any of the mentioned commands?

Thanks in advance

You can use gparted for a Void install
Do the gparted work first, then run the installer and skip the disk partitioning step, but dont forget you still have to mount partitions… at least / and swap and also /boot/efi if it is uefi boot.

4 Likes

You could use a spare USB-Stick for your exercises.

3 Likes

You could also create a huge empty file and test your partitioning skills on that. After all, everything in unix is a file.

5 Likes

You mean like a VM virtual disk?

2 Likes

Just for practicing partitioning, you don’t need a VM. You can just partition the empty file as a regular disk and then link the loopback device to it.

4 Likes

Yeah - a big file…

Done that before…

But it’s been a while…

There’s a bunch of ways you can make a big file… I think using “dd” is one of them - just remember to ensure the output of the “dd” is an actual file somewhere on your system (e.g. /tmp/mybigfile.img) - be careful with “dd” you can hose your system easily if you output incorrectly…

Google search :

e.g. :
“linux create a large file as a pseudo disk device”

Where it comes to the steps about mkfs - you can skip that till you’ve done partitioning on the “fake” virtual device - i.e. just after you created the loop device - use fdisk or parted or cfdisk…

e.g. your pseudo loopback device is /tmp/mybigfile.img

sudo losetup -f
sudo losetup /dev/loopX /tmp/mybigfile.img

then :
sudo fdisk /dev/loopX
or
sudo parted /dev/loopx

5 Likes

Huge thanks to all for the replies

Neville

You can use gparted for a Void install
Do the gparted work first, then run the installer and skip the disk partitioning step, but dont forget you still have to mount partitions… at least / and swap and also /boot/efi if it is uefi boot.

Thanks for the important bold part.

I forgot to say currently I use GParted to:

  • Format an entire HDD/SSD (Either laptop or PC Desktop)
  • Expand partitions for a Virtual Machine (the .vdi file is increased and then it must be reflected/applied to the “internal” partition itself)

Years ago I used GParted to create manually all the partitions, now I trust in the default settings about partitions applied by Debian, Fedora, Peppermint and Ubuntu through their installation process. Therefore I am rusty

You mean like a VM virtual disk?

I thought the same from the beginning but I want avoid create N gigas for this kind of experiment.

It would be fantastic if in the Web there is a host providing an online emulator

Alfred

You could use a spare USB-Stick for your exercises.

Has sense but I need the most realistic scenario. Interesting your approach

Xander

You could also create a huge empty file and test your partitioning skills on that. After all, everything in unix is a file.

Understood. Just being curious, is it safe? If something goes wrong in that file: Does it remain isolate of the rest of the HDD/SSD?

Just for practicing partitioning, you don’t need a VM. You can just partition the empty file as a regular disk and then link the loopback device to it.

Have you ever try that approach? If yes, is there a tutorial of your preference? I mean, from where you learn that approach? What commands are involved?

Dan

Yeah - a big file…

How many gigas? It would be the same as create a new VM and keep it isolated?

There’s a bunch of ways you can make a big file… I think using “dd” is one of them - just remember to ensure the output of the “dd” is an actual file somewhere on your system (e.g. /tmp/mybigfile.img) - be careful with “dd” you can hose your system easily if you output incorrectly…

I remember the dd command when I did do a research about to create a swap partition in a special way … years ago … is highly recommended use that command carefully

Thanks for the commands

Time to research and read many tutorials about how to create big files in Linux

2 Likes

That is OK if there is only one OS on the disk.
If you multiboot, use gparted . I dont trust custom partitioning in an install script.

2 Likes

Yes, I took that approach years ago … I avoid multiboot … I use VirtualBox

1 Like

Have you tried Virt-Manager? It is better than Vbox on Linux.

2 Likes

They never suggested $HOME onto an own partition; nowadays, for me it’s a must. And IIRC their swap size proposals often can be adjusted downwards.

2 Likes

Thanks for the replies

Neville

Have you tried Virt-Manager? It is better than Vbox on Linux.

It is on my “todo” list but due tight of time and since I have many years of experience of VB as host in Windows and Linux, it remains in standby … Furthermore in other posts in this network I am not sure if for the same tool or other is a pain the network configuration, specially for wifi

Alfred

They never suggested $HOME onto an own partition; nowadays, for me it’s a must. And IIRC their swap size proposals often can be adjusted downwards.

Thanks for the feedback, but I use the laptop for developing purposes (Desktop environment) and I am the unique user, I am ok with the default settings.

I think the strategy to have more partitions perhaps is mostly for server environments due security reasons. Correct if I am wrong.

Thanks to all

2 Likes

There are issues with bridges. A normal network ( NAT) is OK

I cant see why you would want wifi from within a VM.
Can you not use the host for wifi then network it to the VM?

2 Likes

Hello Neville

There are issues with bridges. A normal network ( NAT) is OK

In all my VM in VB is used “Bridged Adapter” … Well I use that approach because in many tutorials in 2016 was the most common approach. It lets me use a static ip. If the static ip is offered only by this kind of adapter. I don’t know

I cant see why you would want wifi from within a VM.
Can you not use the host for wifi then network it to the VM?

Well I use the host’s wifi. Maybe I understood incorrectly the problem reported in this network about the wifi

2 Likes

I think what Vbox means by ‘bridge’ is different from what Vmanager means by ‘bridge’.
I always use ‘NAT’ in Vmanager … it is actually a type of bridge, but with NAT protection of the VM so it uses IP masquerading.
You can set Vmanager to an open bridge which is less protected and you can access that from outside of your local network, as long as you set up the routing. I dont use that. but I tested it… it is confusing to setup, maybe because I am not practiced at it.

@daniel.m.tripp uses Vmanager with another type of bridge called ‘Mactap’. I hsve tried that too. It seems a little easier to setup.

This whole area of VM networking is minefield of terminology clashes. It is so bad that people working with different approaches can hardly communicate with one another.

2 Likes

I think what Vbox means by ‘bridge’ is different from what Vmanager means by ‘bridge’.

Really it is a good point!

I always use ‘NAT’ in Vmanager … it is actually a type of bridge, but with NAT protection of the VM so it uses IP masquerading.

Why do you need the bold part?

You can set Vmanager to an open bridge which is less protected and you can access that from outside of your local network, as long as you set up the routing. I dont use that. but I tested it… it is confusing to setup, maybe because I am not practiced at it.

Thanks for that valuable information. I only work in LAN just to avoid security issues

1 Like

It makes it impossible for anyone to see your VM from anywhere other than the host.
I dont really need that I suppose, because the host itself has NAT.
I just use the default. The alternative is an open bridge.

Me too. All my VM’s are in one machine… i did once test accessing them from my other machine, and I needed an open bridge for that.

Now… what does ‘bridge’ in Vbox mean? Does it have NAT , or is it an open bridge, or a TAP device or something else?

2 Likes

NAT is the default on virt-manager - it works - it’s easy… Just as easy as VBox… But not ideal in my “use case” - i.e. it’s the default in both VM solutions…

Every time a new season of Mr Robot would air - the intertubes would get flooded with n00bs trying to get USB / NIC passthrough of a WiFi dongle into a VirtualBox VM running Kali Linux - i.e. they didn’t have a clue and shouldn’t be using Kali as their first distro / intro to Linux… So anyway - Kali is a good reason to want WiFi in a guest VM - but - you have to know how to setup USB passthrough so your VM manager and pass-through the real device - into the VM - relatively easy in VBox - never tried it in QEMU/KVM - but I know there are plenty of people out there using KVM and passing through things like GPU to a VM guest (e.g. hosting Windows 10 VM and accessing 3D accelaration to an NVidia GPU).

No - I don’t use Macvtap (note the “v”) - I was using it - and it’s easy… It’s the closest thing to “bridged” mode anyway… Your VM will request a DHCP lease off your LAN, you can ping / ssh to the VM from other hosts on the LAN - but - I was unable to SSH / ping the LAN IP address of the VM from my KVM server itself…

Bridged Mode, with a bridged adaptor in my O/S (setup using NetworkManager - actually “nmtui”) - works just like the VM is a real computer on my LAN. However - you have know what your bridged device name is in your O/S - e.g. output of the “ip a” command…

Here’s what my bridge that I use in QEMU / KVM looks like in nmtui :


It’s sorta “dynamic” - i.e. that “slave” vnet18 is one of my KVM guests - actually GhostBSD - but I still haven’t figured out why I can’t SSH direct to it… I can ping it’s IP address from the KVM “host”, and I can ping it from other devices on my LAN… I can ssh to localhost on the GhostBSD guest itself - so - “sshd” is running and answering… Can only think it’s some kinda firewall in FreeBSD?

Just checked - yeah - it was the FreeBSD firewall “pf” blocking… I don’t need no steenking firewall! So I disabled it and rebooted…

Like @Manuel_Jordan - I’m happy to accept the defaults - in fact - I don’t like being “locked” down to finite sizes of separate partitions then hitting a wall when one runs out of space… It’s probably the most common cause of after hours call outs when a Linux server doesn’t have enough space in /var and /var/log and it triggers P1 or P2 (high severity) alert…

I don’t dual boot - so I don’t need to have a common $HOME - and - even then - 80% of the data I access in my $HOME is shared / sync’d to my other computers, using Resilio Sync…

And it gets worse - everyone is pushing for Linux servers to have CIS1 or CIS2 hardening profiles… it makes capacity planning hard… When you’re developing a VMware “template” - you have to make arbitrary decisions about sizings “on the fly”… Fortunately - we mostly use LVM - and partitions can be expanded “on the fly”…

On ALL my Linux systems - I just have 3 partitions /boot, /boot/efi and “/”… and I mostly disable swap - and - I VASTLY prefer swapfile to swap partition - makes things more flexible…

3 Likes