Nix-disk, formerly called Nix Disk Manager, lets you mount a secondary disk (a second SSD, a storage drive, an external drive that stays plugged in): you choose a folder, the disk becomes accessible there, and it is then mounted automatically at every startup. Nix-disk can also remove a mount point and format a blank disk. For a network share, see Nix Samba or Mounting a CIFS network share (in French) instead.

Note

Nix-disk's interface is displayed in French, even on a system set to English. This guide quotes each label exactly as it appears on screen, followed by its translation in parentheses.

Note

A mount point is a folder that gives access to the contents of a disk, for example /media/Jeux.

Launching Nix-disk

Nix-disk comes preinstalled on every edition of GLF OS. In the applications menu, open the GLF Apps folder (the GLF Apps submenu on KDE Plasma) and click Nix-disk. Depending on the KDE launcher settings, the name Disk Manager may appear instead.

No password is requested at launch: you will be asked for it in a terminal, when a change is applied.

The main window

Nix-disk shows one card per disk, with:

Nix-disk main window with an unmounted secondary disk

System partitions and swap space are hidden, so the disk where GLF OS is installed usually does not appear. If there is no other disk, Nix-disk shows Aucun disque gérable disponible (no manageable disk available).

Note

Déjà montée means that a mount point is declared in the system configuration, not that the disk is currently in use. A USB stick opened from the file manager therefore shows as Non montée.

Mounting a disk

  1. Click Gérer under the disk. The Gérer /dev/sdb (Manage /dev/sdb) window lists its partitions.
  2. Under Points de montage : (mount points), on the line that starts with /media/, type only the folder name in the field nom_du_dossier (ex: data) (folder_name, e.g. data): Jeux gives /media/Jeux.
  3. Click the round + button, or press Enter.
  4. In the Confirmer l'ajout du point de montage (confirm adding the mount point) window, click Confirmer (Confirm).
  5. The Reconstruction de la configuration NixOS en cours... (rebuilding the NixOS configuration) banner appears and a terminal opens. Type your password (nothing appears while you type, this is normal), then press Enter.
  6. Wait for the ✅ REBUILD TERMINÉ AVEC SUCCÈS (rebuild completed successfully) message, which can take several minutes, then press Enter or close the terminal.
The Gérer (Manage) window with the folder name Jeux typed in, before adding it

The card then shows ⚠️ Déjà montée: /media/Jeux. Since the configuration is applied immediately, the disk should be accessible in the chosen folder without a restart; if it is not, restart your computer. From then on, it is mounted at every startup and, on GNOME, appears in the sidebar of Files. If the disk is missing at startup, GLF OS still boots.

Tip

Choose a simple folder name with no spaces, accents or quotation marks, for example Jeux or Donnees: Nix-disk does not check the characters you type.

Important

Nix-disk only sets write permissions for a disk it has formatted. On an existing ext4 disk, give yourself the permissions once the disk is mounted: sudo chown "$USER": /media/Jeux. An NTFS disk is normally assigned to the first account created; an exFAT or FAT partition may remain read-only for your account.

Warning

Do not mount a Btrfs partition with Nix-disk: it would then refuse to open, and you could no longer remove that mount with it. Use the personal configuration described below instead.

Removing a mount point

  1. Click Gérer under the disk.
  2. To the right of the mount point, click the trash can icon, Supprimer ce point de montage (delete this mount point).
  3. In the Confirmer la suppression du point de montage (confirm deleting the mount point) window, check the folder shown, then click Confirmer (pressing Enter does the same).
  4. Type your password in the terminal and wait for ✅ REBUILD TERMINÉ AVEC SUCCÈS.

No data is erased: the disk is simply no longer mounted. Nix-disk cannot edit a mount point: to change the folder, add the new one, then remove the old one.

Formatting a blank disk

Caution

Formatting permanently erases the entire contents of the disk. Disque vierge only means that no usable partition was detected: the disk is not necessarily empty. Only one confirmation is requested, and pressing Enter in the name field also starts formatting. Check the disk and its size before continuing.

  1. Click Formater on the Disque vierge card. The Formater le disque (format the disk) window shows the target disk, for example /dev/sdb (500 GB).
  2. In Nom du volume : (volume name), keep the suggested name or type your own (16 characters maximum).
  3. Click Formater le disque, then type your password in the terminal.
  4. Wait for ✅ FORMATAGE TERMINÉ AVEC SUCCÈS (formatting completed successfully), then press Enter or close the terminal.

The disk gets a single ext4 partition owned by your account. No mount point is created: next, click Gérer and follow the steps in "Mounting a disk".

If Nix-disk refuses to open

When it starts, Nix-disk examines the system's storage configuration. If it finds a layout it cannot change safely, it shows Modification désactivée par sécurité (editing disabled for safety) along with the detected items, for example Btrfs (subvolumes) or LUKS (chiffrement) (LUKS encryption). The Fermer (Close) button quits the application: no feature is available.

This lock protects your system. It applies to:

The message suggests editing /etc/nixos/hardware-configuration.nix by hand: do not do it. Declare the mount in your personal configuration instead.

Mounting a disk through your personal configuration

The mount is declared in /etc/nixos/customConfig/default.nix, which you open and save with administrator rights as explained in How to add your own programs.

  1. Find the disk and its identifier:

    lsblk -f
    

    Identify the partition using the NAME, FSTYPE and MOUNTPOINTS columns, then note its UUID value.

  2. Below the # Add your custom configuration here ↓ comment, add:

      fileSystems."/media/Donnees" = {
        device = "/dev/disk/by-uuid/remplacez-par-l-uuid";
        fsType = "ext4";
        options = [ "nofail" ];
      };
    
    • The path you choose between the quotation marks is the mount point.
    • Replace remplacez-par-l-uuid with the UUID you noted.
    • fsType must match the FSTYPE column.
    • nofail prevents a missing disk from blocking startup.
  3. Save, apply with glf-update, then restart. glf-switch applies the change without restarting. See GLF commands.

  4. For an ext4 disk, give yourself write permissions once the disk is mounted:

    sudo chown "$USER": /media/Donnees
    

To remove this mount, delete the block and apply again.

Warning

Do not declare the same mount point both in customConfig and with Nix-disk. Nix-disk does not see mounts from customConfig: the partition shows as Non montée there, and adding a mount on the same folder would create a duplicate declaration.

Good to know

The Partitions Manquantes Détectées (missing partitions detected) dialog

Files it changes

Nix-disk saves mount points in /etc/nixos/hardware-configuration.nix, then rebuilds the system.

Warning

Never edit hardware-configuration.nix by hand, nor configuration.nix, flake.nix, flake.lock or customized.nix. Your own mounts belong only in customConfig.

See also