# Backup - out of disk space

**URL:** <https://forum.gitea.com/t/backup-out-of-disk-space/7052>\
**Category:** General\
**Created:** [April 10, 2023, 6:05pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052 "2023-04-10T18:05:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kjsdnbifjud](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kjsdnbifjud](https://forum.gitea.com/u/kjsdnbifjud)\
**Post date:** [April 10, 2023, 6:05pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/1 "2023-04-10T18:05:55Z")

</div>

I deployed new gitea with rootless podman (+ postgres).  
I created one empty repository (readme + license).  
I attempted to backup gitea. Inside container I executed: `gitea dump -c /etc/gitea/app.ini`  
It failed with message: no space left on device  
When inspected the unfinished backup file, it was 18,5 GB in size…  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/1/12fe978a042b0d87ae3b1db0631d06c3a9cb7fd6.png)

Obviously I am missing something…  
Because this cannot be right.  
Any thoughts?

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [April 11, 2023, 7:11pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/2 "2023-04-11T19:11:34Z")

</div>

My guess is it is entering an infinite loop of files and directories through a symbolic link. Are you able to list the files inside through something like `unzip -lv gitea-dump-xxx.zip`? If so, posting the result could help troubleshoot further (just the first thousandish lines would be OK).

You can pipe it to a file as well to avoid terminal buffer limits `unzip -lv gitea-dump-xxx.zip > output.txt`

---

<div class="post-metadata">

**Author:** ![kjsdnbifjud](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kjsdnbifjud](https://forum.gitea.com/u/kjsdnbifjud)\
**Post date:** [April 12, 2023, 3:42pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/3 "2023-04-12T15:42:56Z")

</div>

The zip file is damaged…  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/6/6bf52d8683e8947d0998b2980ea46c2866231d97.png)

---

<div class="post-metadata">

**Author:** ![kjsdnbifjud](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kjsdnbifjud](https://forum.gitea.com/u/kjsdnbifjud)\
**Post date:** [April 12, 2023, 3:43pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/4 "2023-04-12T15:43:30Z")

</div>

The backup file is created in `/var/lib/gitea` and not in `/tmp` - that is I think the problem.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/8/858daba2620c87bfb408fa9c4e0e8cd22717760b.png)

---

<div class="post-metadata">

**Author:** ![kjsdnbifjud](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kjsdnbifjud](https://forum.gitea.com/u/kjsdnbifjud)\
**Post date:** [April 12, 2023, 3:44pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/5 "2023-04-12T15:44:11Z")

</div>

Default paths in container:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/1/1545be1727bbc90594064a8be82c029a299eb2a3.png)

---

<div class="post-metadata">

**Author:** ![kjsdnbifjud](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kjsdnbifjud](https://forum.gitea.com/u/kjsdnbifjud)\
**Post date:** [April 12, 2023, 3:45pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/6 "2023-04-12T15:45:32Z")

</div>

I resolved the issue with mounting dedicated volume for backups and running:

```auto
gitea dump -c /etc/gitea/app.ini -f /backup/backup.zip

```

I have limits on included media files… and number of posts per minute too… 🙂

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [April 13, 2023, 12:41am UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/7 "2023-04-13T00:41:04Z")

</div>

No worries, glad you got it resolved! I think your hypothesis of the dump command trying to backup the dump zip is probably right.

---

<div class="post-metadata">

**Author:** ![kumarmuthu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/kumarmuthu/32/4657_2.png) [@kumarmuthu](https://forum.gitea.com/u/kumarmuthu)\
**Post date:** [May 2, 2024, 12:04pm UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/8 "2024-05-02T12:04:09Z")

</div>

Hi,

- I am also facing the same issue. I have a repo, it is just has readme file only.

- I have tried both sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini -f backup.zip and sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini  
But still I am facing the same error.

- I have created VM with 800GB memory space for root, then I installed gitea, but the gitea dump utilized the 96% memory space(751G).

- Please explain more about **mounting dedicated volume for backups**

- Please let me know yours gitea backup size, please share your system memory size.

```auto
automation-gitea-clone:~$ df -hl
Filesystem Size Used Avail Use% Mounted on
tmpfs 197M 1.3M 196M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 784G 751G 0
100% /
tmpfs 982M 0 982M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 131M 1.7G 8% /boot
/dev/sda1 1.1G 6.1M 1.1G 1% /boot/efi
tmpfs 197M 4.0K 197M 1% /run/user/1000

```

**Without -f :**

```auto
automation-gitea-clone:/usr/bin/data$ sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini

2024/05/02 04:58:50 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: Console(Console:info)
2024/05/02 04:58:50 ...dules/setting/log.go:286:generateNamedLogger() [I] Router Log: Console(console:info)
2024/05/02 04:58:50 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2024/05/02 04:58:50 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2024/05/02 04:58:50 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2024/05/02 04:58:50 ...s/storage/storage.go:175:initAttachments() [I] Initialising Attachment storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/attachments
2024/05/02 04:58:50 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/avatars
2024/05/02 04:58:50 ...s/storage/storage.go:191:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-avatars
2024/05/02 04:58:50 ...s/storage/storage.go:185:initLFS() [I] Initialising LFS storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2024/05/02 04:58:50 ...s/storage/storage.go:197:initRepoArchives() [I] Initialising Repository Archive storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-archive
2024/05/02 04:58:50 ...s/storage/storage.go:207:initPackages() [I] Initialising Packages storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/packages
2024/05/02 04:58:50 cmd/dump.go:246:runDump() [I] Dumping local repositories... /var/lib/gitea/data/gitea-repositories
2024/05/02 04:58:50 cmd/dump.go:287:runDump() [I] Dumping database...
2024/05/02 04:58:50 cmd/dump.go:299:runDump() [I] Adding custom configuration file from /etc/gitea/app.ini
2024/05/02 04:58:50 cmd/dump.go:318:runDump() [I] Custom dir /usr/bin/custom doesn't exist, skipped
2024/05/02 04:58:50 cmd/dump.go:327:runDump() [I] Packing data directory.../usr/bin/data
**Failed to include data directory: data/gitea-dump-1714625930.zip: copying contents: write gitea-dump-1714625930.zip: no space left on device**
2024/05/02 05:25:41 cmd/dump.go:162:fatal() [F] Failed to include data directory: data/gitea-dump-1714625930.zip: copying contents: write gitea-dump-1714625930.zip: no space left on device

```

**Used -f :**

```auto
automation-gitea-clone:/usr/bin/data$ sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini -f backup.zip
2024/05/02 11:36:46 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: Console(Console:info)
2024/05/02 11:36:46 ...dules/setting/log.go:286:generateNamedLogger() [I] Router Log: Console(console:info)
2024/05/02 11:36:46 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2024/05/02 11:36:46 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2024/05/02 11:36:46 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2024/05/02 11:36:46 ...s/storage/storage.go:175:initAttachments() [I] Initialising Attachment storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/attachments
2024/05/02 11:36:46 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/avatars
2024/05/02 11:36:46 ...s/storage/storage.go:191:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-avatars
2024/05/02 11:36:46 ...s/storage/storage.go:185:initLFS() [I] Initialising LFS storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2024/05/02 11:36:46 ...s/storage/storage.go:197:initRepoArchives() [I] Initialising Repository Archive storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-archive
2024/05/02 11:36:46 ...s/storage/storage.go:207:initPackages() [I] Initialising Packages storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/packages
2024/05/02 11:36:46 cmd/dump.go:246:runDump() [I] Dumping local repositories... /var/lib/gitea/data/gitea-repositories
2024/05/02 11:36:46 cmd/dump.go:287:runDump() [I] Dumping database...
2024/05/02 11:36:46 cmd/dump.go:299:runDump() [I] Adding custom configuration file from /etc/gitea/app.ini
2024/05/02 11:36:46 cmd/dump.go:318:runDump() [I] Custom dir /usr/bin/custom doesn't exist, skipped
2024/05/02 11:36:46 cmd/dump.go:327:runDump() [I] Packing data directory.../usr/bin/data
Failed to include data directory: data/backup.zip: copying contents: write backup.zip: no space left on device
2024/05/02 12:02:27 cmd/dump.go:162:fatal() [F] Failed to include data directory: data/backup.zip: copying contents: write backup.zip: no space left on device

```

```auto
automation-gitea-clone:/usr/bin/data$ df -hl
Filesystem Size Used Avail Use% Mounted on
tmpfs 197M 1.3M 196M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 784G 751G 0 100% /
tmpfs 982M 0 982M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 131M 1.7G 8% /boot
/dev/sda1 1.1G 6.1M 1.1G 1% /boot/efi
tmpfs 197M 4.0K 197M 1% /run/user/1000

automation-gitea-clone:/usr/bin/data$ ls -lrt
total 780082208
drwxrwxr-x 3 git git 4096 May 2 11:36 tmp
drwxrwxr-x 2 git git 4096 May 2 11:36 repo-avatars
drwxrwxr-x 2 git git 4096 May 2 11:36 repo-archive
drwxrwxr-x 2 git git 4096 May 2 11:36 packages
drwxrwxr-x 2 git git 4096 May 2 11:36 avatars
drwxrwxr-x 2 git git 4096 May 2 11:36 attachments
-rw-rw-r-- 1 git git 798804058112 May 2 12:02 backup.zip
automation-gitea-clone:/usr/bin/data$

```

Thanks

---

<div class="post-metadata">

**Author:** ![kumarmuthu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/kumarmuthu/32/4657_2.png) [@kumarmuthu](https://forum.gitea.com/u/kumarmuthu)\
**Post date:** [May 6, 2024, 5:25am UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/9 "2024-05-06T05:25:14Z")

</div>

Works fine.

```auto
sudo -H -u git /usr/bin/gitea dump -c /etc/gitea/app.ini -f /tmp/git_backup/gitea-dump.zip

sudo -H -u git /usr/bin/gitea restore -c /etc/gitea/app.ini -f /tmp/gitea_restore

```

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [May 6, 2024, 10:28am UTC](https://forum.gitea.com/t/backup-out-of-disk-space/7052/10 "2024-05-06T10:28:07Z")

</div>


