> Source: [sk116679](https://support.checkpoint.com/results/sk/sk116679)

# sk116679 - Snapshot creation on Gaia OS is stuck at 1-2%

| Property | Value |
|----------|-------|
| Solution ID | sk116679 |
| Date Created | 2017-04-03 |
| Last Modified | 2022-03-29 |
| Technical Level | General |
| Products | Security Gateway, Security Management Server |
| Versions | R82.10, R82, R81.20, R82.10, R82, R81.20 |
| OS | Gaia |

## Symptoms

- Snapshot creation on Gaia OS is stuck at 1-2%.  

Example:

```

[Expert@HostName:0]# clish -c "show snapshots"
Restore points:
---------------

Restore point now under creation:
---------------------------------
snapshot_test (1%)
```

## Cause

The number of temporary files in the *$CPDIR/tmp/* directory or other directories is very large (for example, more than 2,000,000).

**Note:** On the Multi-Domain Security Management Server, check for this in the context of every Domain Management Server.

Example:

```
[Expert@HostName:0]# ls -l $CPDIR/tmp/ | head -n 12
-rw-rw-r--  1 admin root         0 Mar  9 01:05 fileFVwlJL
-rw-rw-r--  1 admin root         0 Mar  6 16:02 fileFW2POv
-rw-rw-r--  1 admin root         0 Mar 10 16:31 fileFW6Pi4
-rw-rw-r--  1 admin root         0 Mar 13 15:30 fileFW9LP9
-rw-rw-r--  1 admin root         0 Mar  7 18:32 fileFWD0IG
-rw-rw-r--  1 admin root         0 Mar  9 22:44 fileFWGAGW
-rw-rw-r--  1 admin root         0 Mar 10 07:40 fileFWJit5
-rw-rw-r--  1 admin root         0 Mar  9 17:34 fileFWKDpx
-rw-rw-r--  1 admin root         0 Mar 10 16:23 fileFWPVIC
-rw-rw-r--  1 admin root         0 Mar 13 17:41 fileFWWwCu
-rw-rw-r--  1 admin root         0 Mar  9 11:21 fileFWZYiZ
-rw-rw-r--  1 admin root         0 Mar 10 14:01 fileFWekTQ
```

## Solution

This problem was fixed. The fix is included in:

* [Jumbo Hotfix Accumulator for R80.20](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk137592) starting from Take 173
* [Jumbo Hotfix Accumulator for R80.10](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk116380) starting from Take 283

**The code was improved** : A new feature allows the user to exclude files and directories from collection in the snapshot image.  

**Note:** If the issue occurs on a higher version or if installing the fix does not solve the issue, check the inode usage for the lv-current partition with the `df -i` command. If it is above the 1-4% threshold, refer to [sk171685](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk171685&partition=Advanced&product=Data) or [sk36754](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk36754&partition=Advanced&product=Quantum). Snapshots contain copies of the lv-current partition. Accordingly, high inode use can severely delay the time it takes to create a snapshot.

### **How to use the feature:**

1. Install the Hotfix below.

2. Create the following file: *# touch /var/log/excluded_files_snapshot/snapshot_excluded_files.txt*

3. And use it to write the files you do not want collected in the snapshot (full path):

*# cat /var/log/excluded_files_snapshot/snapshot_excluded_files.txt*   
*/opt/CPcvpn-R77/tmp*   
*/opt/CPUserCheckPortal/session*   
*/var/opt/CPshrd-R77/tmp*

### **How do I know which files and directories to exclude?**

Any file or directory that you do not want to be collected should be excluded. Run the script below to check which directory causes the snapshot issue:

1. `# vi filecount.sh`  

2. Paste this script:   
   > ` #!/bin/bash`  
   > ` if [ $# -ne 1 ];then`  
   > `` echo "Usage: `basename $0` DIRECTORY"``  
   > ` exit 1`  
   > ` fi`  
   > ` echo "Wait a moment if you want a good top of the busy folders..."`  
   > ` find "$@" -type d -print0 2>/dev/null | while IFS= read -r -d '' file; do`  
   > `` echo -e `ls -A "$file" 2>/dev/null | wc -l` "files in:\t $file"``  
   > ` done | sort -nr | head | awk '{print NR".", "\t", $0}'`  
   > ` exit 0`
3. ` # chmod 777 filecount.sh`  

4. `# ./filecount.sh /`

This script lists the 10 directories with the largest amount of files.

**Example**output:

*\[Expert@HostName:0\]# ./filecount.sh /*   
*Wait a moment if you want a good top of the busy folders...*   
*1. 3445610 files in: /opt/CPcvpn-R77/tmp*   
*2. 3838 files in: /opt/CPUserCheckPortal/htdocs/UserCheck/images/appicons*   
*3. 3006 files in: /opt/KAV/bin/bases*   
*4. 821 files in: /var/opt/CPsuite-R77/fw1/conf*   
*5. 596 files in: /opt/CPsuite-R77/fw1/lib*   
*6. 526 files in: /usr/include/linux*   
*7. 458 files in: /var/opt/CPsuite-R77/fw1/conf/SMC_Files/cpmi_files/file_storage/dlp*   
*8. 451 files in: /tmp*   
*9. 443 files in: /var/opt/CPsuite-R77/fw1/conf/defaultDatabase*   
*10. 352 files in: /usr/bin*

In the **example** above, */opt/CPcvpn-R77/tmp* includes more than 3M files, all of which are temp files and not useful for snapshot creation. Accordingly, we can add it to the */var/log/excluded_files_snapshot/snapshot_excluded_files.txt.*

### Recommended directories to be added to the file:

/opt/CPcvpn-R77/tmp  
/opt/CPUserCheckPortal/session  
/var/opt/CPshrd-R77/tmp

If you choose not to upgrade, Check Point can supply a **Hotfix** . [Contact Check Point Support](https://www.checkpoint.com/support-services/contact-support/) to get a Hotfix for this issue. A Support Engineer will make sure the Hotfix is compatible with your environment before providing the Hotfix. For faster resolution and verification, please collect [CPinfo files](http://supportcontent.checkpoint.com/solutions?id=sk92739) from the Security Management Server and Security Gateways involved in the case.

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
