Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the default installation directory of Snap in Centos7?

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

How to modify the default installation directory of Snap in Centos7? In order to solve this problem, today the editor summarizes this article to modify the default installation directory of Snap, hoping to help more friends who want to solve this problem to find a more simple and easy way.

Description

Recently received the company server alarm message, mount=/var/lib/snapd/snap/core/8592 100 > = 90. This is because the installation of Snap takes up disk space (the default installation directory is / var/lib/snapd). If you want Snap to be installed in a specific directory, you cannot use the method of creating soft links (ln-s) to associate to the new installation directory, otherwise the application of Snap will not start normally.

Here are the main ways to change the default installation directory ~

Main steps

(1) check the mount of snap

Df-h | grep snapd/dev/loop2 92m 92m 0100% / var/lib/snapd/snap/core/8592/dev/loop0 92m 92m 0100% / var/lib/snapd/snap/core/8689

(2) check the running status of snapd service

Systemctl status snapd

(3) stop snapd service

Systemctl stop snapd

(4) Uninstall snapd's / dev/loopxx device

Umount / dev/loop2umount / dev/loop0

(5) create a new data directory for snap

Mkdir / root/snap/snapd

(6) copy data

Rsync-avzP / var/lib/snapd/ / root/snap/snapd/

(7) backup of other data

Cp / etc/fstab / etc/fstab.bakmv / var/lib/snapd / var/lib/snapd.bak

(8) write snap mount information into / etc/fstab file

Echo "/ root/snap/snapd / var/lib/snapd none bind 0" | tee-a / etc/fstab

(9) remount the snap in fstab or restart the machine

Mkdir / var/lib/snapdmount-a

(10) check whether the snapd service has been mounted and started successfully

Ls / var/lib/snapd/ | if grep snaps# exists, the mount is successful. Otherwise, fail ~ systemctl start snapdsnap list

The method of modifying the default installation directory of Snap is shared here. Solving the problem is not just the method analyzed in the article and everyone, but the accuracy of the method analyzed in this article is beyond doubt. If you like this article, you might as well share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report