In Manjaro chroot, pacman is unable to lock database; and no space left on device

Hi. Using Manjaro KDE. All of sudden yesterday my desktop corrupted, wallpapers got lost, some programs froze and no other programs could be opened. Tried to reboot and it failed.
So I booted in another OS (archlinux) and chrooted into manjaro root successfully. But here are the commands I tried with errors:

pacman -Sy
:: Synchronising package databases...
error: failed to synchronize all databases (unable to lock database)

But there is no db.lck file in


Neither in


as suggested by this post.

Trying to remove a flatpak gives error about no space left:

flatpak remove signal
Found installed ref ‘app/org.signal.Signal/x86_64/stable’ (system). Is this correct? [Y/n]:

        ID                      Branch       Op
 1. [✗] org.signal.Signal       stable       r

Error: No space left on device
error: Failed to uninstall org.signal.Signal: No space left on device

But df -h / shows:

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2   70G   58G   13G  82% /

Even a simple touch command fails

touch test /home
touch: cannot touch 'test': No space left on device

Remember all the above commands are run in chroot. I also mention that the manjaro root partition is btrfs. And btrfs check shows no error. No quotas on it either.

Please help. Thank you.

Did you also remember to mount the sub volumes in the chroot environment; considering it’s BTRFS?

You will need to list subvolumes and mount them accordingly for a chroot with btrfs will work

manjaro chroot btrfs -

Before attempting to chroot - assuming your root subvolume is named @

mount -t btrfs -o subvol=@ /mnt

Then chroot

manjaro-chroot /mnt /bin/bash

Are you out of Space ?

The other possibility is, that your btrfs filesystem is mounted ro

 mount -t btrfs       

Welcome to Manjaro! :smiling_face_with_three_hearts:

  1. Please read the information behind this link. It will help you to post necessary information.
  1. Please press the three dots below your post and then press the :pencil2:
  • If you give us information about your system, we can see what we’re talking about and make better suggestions.
  • You can do this by using inxi in a terminal or in console.
sudo inxi --admin --verbosity=8 --filter --no-host --width --repos
  • Personally identifiable information such as serial numbers and MAC addresses are filtered out by this command
  • Presenting the information in this way allows everyone to be familiar with the format and quickly find the items they need without missing anything.
  1. Copy the output from inxi (including the command) and paste it into your post.
  • To make it more readable, add 3 backticks ``` on an extra line before and after the pasted text.

Have you already :mag: for your problem in the forum ? (Wisdom lies in asking → listening → reading :wink: )

Thanks. As I posted, df command shows I still have 18% (13 Gb) space left. the manjaro wiki page you linked dies say about the 80% limit, but it also mentions 90% use of space is okay for emergency.
If I am not able to do anything in the partition even from chroot, how do I even reduce the size?

Do not use df on btrfs in this situation !

It also says:

Tip: Check how close you are to “out of space”.

Look at Device unallocated: (not at Free (estimated): ) 1

as root :

btrfs filesystem usage /

Did you try to list the mounts (rw / ro) ?

mount -t btrfs


First you need to know the exact cause of the problem. Then we can discuss the solution. At least that’s my approach.

And where is your inxi ?

inxi -F output from archlinux host:

  Host: archlinux Kernel: 6.6.22-1-lts arch: x86_64 bits: 64
  Desktop: Hyprland v: 0.37.1 Distro: Arch Linux
  Type: Laptop System: LENOVO product: 20L6S29E0V
    v: ThinkPad T480 serial: PF1M9QPF
  Mobo: LENOVO model: 20L6S29E0V v: SDK0J40697 WIN
    serial: L1HF93B016S UEFI: LENOVO v: N24ET74W (1.49 )
    date: 08/15/2023
  ID-1: BAT0 charge: 1.1 Wh (5.4%)
    condition: 20.4/24.0 Wh (85.0%) volts: 10.8 min: 11.5
  ID-2: BAT1 charge: 11.6 Wh (64.8%)
    condition: 17.9/24.1 Wh (74.6%) volts: 11.4 min: 11.4
  Info: quad core model: Intel Core i5-8350U bits: 64
    type: MT MCP cache: L2: 1024 KiB
  Speed (MHz): avg: 400 min/max: 400/3600 cores: 1: 400 2: 400
    3: 400 4: 400 5: 400 6: 400 7: 400 8: 400
  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
  Device-2: Bison Integrated IR Camera driver: uvcvideo
    type: USB
  Device-3: SunplusIT Integrated Camera driver: uvcvideo
    type: USB
  Display: wayland server: v: with: Xwayland
    v: 23.2.4 compositor: Hyprland v: 0.37.1 driver: X:
    loaded: modesetting unloaded: vesa dri: iris gpu: i915
    resolution: 1920x1080
  API: EGL Message: EGL data requires eglinfo. Check
  Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel
  API: ALSA v: k6.6.22-1-lts status: kernel-api
  Server-1: PipeWire v: 1.0.4 status: active
  Device-1: Intel Ethernet I219-LM driver: e1000e
  IF: enp0s31f6 state: down mac: e8:6a:64:d3:e9:b0
  Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi
  IF: wlan0 state: up mac: a8:6d:aa:34:17:2d
  Local Storage: total: 476.94 GiB used: 250.26 GiB (52.5%)
  ID-1: /dev/nvme0n1 vendor: Toshiba model: N/A
    size: 476.94 GiB
  ID-1: / size: 33.49 GiB used: 12.08 GiB (36.1%) fs: ext4
    dev: /dev/nvme0n1p5
  ID-2: /boot size: 514 MiB used: 133.9 MiB (26.0%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-1: swap-1 type: partition size: 2.11 GiB used: 0 KiB (0.0%)
    dev: /dev/nvme0n1p3
  System Temperatures: cpu: 45.0 C pch: 39.5 C mobo: N/A
  Fan Speeds (rpm): N/A
  Memory: total: 16 GiB available: 15.37 GiB
    used: 2.68 GiB (17.4%) igpu: 32 MiB
  Processes: 237 Uptime: 2h 23m Shell: Bash inxi: 3.3.33

inxi -F from the chroot env of manjaro

  Kernel 6.6.22-1-lts arch x86_64 bits 64
  Desktop Hyprland v N/A Distro Manjaro Linux
  Type Laptop System LENOVO product 20L6S29E0V v ThinkPad T480 serial <filter>
  Mobo LENOVO model 20L6S29E0V v SDK0J40697 WIN serial <filter> UEFI LENOVO v N24ET74W (1.49 )
    date 08/15/2023
  ID-1 BAT0 charge 1.1 Wh (5.4%) condition 20.4/24.0 Wh (85.0%) volts 10.8 min 11.5
  ID-2 BAT1 charge 11.2 Wh (62.6%) condition 17.9/24.1 Wh (74.6%) volts 11.4 min 11.4
  Info quad core model Intel Core i5-8350U bits 64 type MT MCP cache L2 1024 KiB
  Speed (MHz) avg 450 min/max 400/3600 cores 1 400 2 400 3 400 4 400 5 400 6 800 7 400 8 400
  Device-1 Intel UHD Graphics 620 driver i915 v kernel
  Device-2 Bison Integrated IR Camera driver uvcvideo type USB
  Device-3 Bison SunplusIT Integrated Camera driver uvcvideo type USB
  Display wayland server v with Xwayland v 23.2.4 driver N/A
  API EGL v 1.5 drivers iris,swrast platforms surfaceless,device
  API OpenGL v 4.6 compat-v 4.5 vendor mesa v 24.0.2-manjaro1.1 note incomplete (EGL sourced)
    renderer Mesa Intel UHD Graphics 620 (KBL GT2), llvmpipe (LLVM 16.0.6 256 bits)
  API Vulkan Message No Vulkan data available.
  Device-1 Intel Sunrise Point-LP HD Audio driver snd_hda_intel
  API ALSA v k6.6.22-1-lts status kernel-api
  Device-1 Intel Ethernet I219-LM driver e1000e
  IF enp0s31f6 state down mac <filter>
  Device-2 Intel Wireless 8265 / 8275 driver iwlwifi
  IF wlan0 state up mac <filter>
  Local Storage total 476.94 GiB used 69.24 GiB (14.5%)
  ID-1 /dev/nvme0n1 vendor Toshiba model N/A size 476.94 GiB
  ID-1 / size 70 GiB used 57.16 GiB (81.7%) fs btrfs dev /dev/nvme0n1p2
  ID-1 swap-1 type partition size 2.11 GiB used 0 KiB (0.0%) dev /dev/nvme0n1p3
  System Temperatures cpu 43.0 C pch 40.0 C mobo N/A
  Fan Speeds (rpm) N/A
  Memory total 16 GiB available 15.37 GiB used 2.66 GiB (17.3%) igpu 32 MiB
  Processes 0 Uptime 2h 26m Client systemd inxi 3.3.33
 btrfs filesystem usage
btrfs filesystem usage: not enough arguments: 0 but at least 1 expected

I did not understand what was expected here.

mount -t btrfs
/dev/nvme0n1p2 on /mnt/test type btrfs

So I guess btrfs is mounted as rw.
Please let me know if I need to present something else. Thanks.

Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

Mounting other subvolumes is not possible, apparantly.
Trying to mount btrfs root partition in /mnt/test, sudo mount -o subvol=@ /dev/nvme0n1p2 /mnt/test is successful. But creating cache and log dir within /mnt/test shows error:

cannot create directory ‘/mnt/test/cache’: No space left on device

It is possible to create those dir before mounting btrfs, but it gets removed after mounting.

My fault:

sudo btrfs filesystem usage /   

but help is available:

btrfs filesystem usage --help
usage: btrfs filesystem usage [options] <path> [<path>..]

    Show detailed information about internal filesystem usage .

    -b|--raw                  raw numbers in bytes 
    -h|--human-readable       human friendly numbers, base 1024 (default) 
    -H                        human friendly numbers, base 1000 
    --iec                     use 1024 as a base (KiB, MiB, GiB, TiB) 
    --si                      use 1000 as a base (kB, MB, GB, TB) 
    -k|--kbytes               show sizes in KiB, or kB with --si 
    -m|--mbytes               show sizes in MiB, or MB with --si 
    -g|--gbytes               show sizes in GiB, or GB with --si 
    -t|--tbytes               show sizes in TiB, or TB with --si 
    -T                        show data in tabular format btrfs filesystem usage help


mount -t btrfs 

is missing

If you only provide information in homeopathic doses and only after the second request, you are not only wasting your own time, but also the time of those who want to help you.

I only have a limited window of time in which I am able to help. It’s the same with others.

sudo btrfs filesystem usage /

    Device size:		  70.00GiB
    Device allocated:		  70.00GiB
    Device unallocated:		   1.00MiB
    Device missing:		     0.00B
    Device slack:		     0.00B
    Used:			  57.01GiB
    Free (estimated):		  12.73GiB	(min: 12.73GiB)
    Free (statfs, df):		  12.73GiB
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		 150.12MiB	(used: 0.00B)
    Multiple profiles:		        no

Data,single: Size:65.98GiB, Used:53.25GiB (80.71%)
   /dev/nvme0n1p2	  65.98GiB

Metadata,DUP: Size:2.00GiB, Used:1.88GiB (93.91%)
   /dev/nvme0n1p2	   4.00GiB

System,DUP: Size:8.00MiB, Used:16.00KiB (0.20%)
   /dev/nvme0n1p2	  16.00MiB

   /dev/nvme0n1p2	   1.00MiB

Please see my previous reply for the output of mount -t btrfs

I have had time to look into how you chroot a btrfs filesystem.

On the live ISO switch to root context

First mount the device

mount -t btrfs /dev/<part> /mnt

Then list the content of /mnt to locate you root subvolume

Example listing

 $ ls /mnt
@home @root @snapshots

When you know the root - often it is @ or @root.

Umount the device

umount /mnt

Mount the root subvolume

mount -t btrfs /dev/<part> /mnt -o subvol=@root

Most installations is using grub so mount your $esp (EFI) to /mnt/boot/efi

mount /dev/<part> /mnt/boot/efi

Now you can chroot into the system

manjaro-chroot /mnt /bin/bash

Then you can begin to do your thing.

When you are done - exit chroot and unmount

umount -R /mnt
1 Like

Did all that already right. I can go in chroot env. The problem is

# pacman -Sy
:: Synchronising package databases...
error: failed to synchronize all databases (unable to lock database)
# touch /mnt/kk
touch: cannot touch '/mnt/kk': No space left on device

Which seems to be a false error, as there is no db.lck as well as there is 13 Gb space left in the partition.

No not false - btrfs is blocking writes to the file system - often this is caused by errors in the datastructures - thus the message ‘no space left on device’.

To verify that - exit chroot and unmount /mnt

Then run - in root context - target the unmounted partition

btrfs check /dev/<part>

I have very little experience with btrfs - what I suggest is based on running btrfs commands with the -h to explore what commands are available and what options can be used.

That means that the same information is available to you and I suggest you dig into why btrfs blocks writes to the file system - this is not a pacman error but an issue with your filesystem.

btrfs is very, very picky and it may block writes if it determines the data structures has errors.

To see what is in use on your partition

btrfs filesystem du /

Or what is considered free space

btrfs filesystem df /

I don’t use btrfs, but it seems that you really have run out of space.

You are out of space !

I do not know how you got there. But Btrfs - Manjaro will tell you how to get out of this situation.

  • A balance with a filter for 50% may be sufficient. But that’s probably not enough.

The link explains how to proceed and why.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.