简体   繁体   English

如何使用linux ubuntu找到哪些文件在哪个分区上

[英]How do you locate which files are on which partition with linux ubuntu

I have a linux box with a partition full, the partition being full is stopping SQL from being started. 我有一个Linux盒,其中的分区已满,分区已满将阻止SQL的启动。 I Need to work out what files I need to delete in order to free up space on the partition, I have tried deleting backup database files from mysql by hand using rm, and deleting old log files, but this just frees up more space from sda8 - which has plenty of space. 我需要弄清楚需要删除哪些文件以释放分区上的空间,我尝试使用rm从mysql手动删除备份数据库文件,并删除旧的日志文件,但这只是从sda8释放了更多空间-有足够的空间。 Does anyone know how to find out which files are in sda7? 有谁知道如何找出sda7中的文件?

Here is the output of df -h 这是df -h的输出

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             4.6G  1.2G  3.2G  27% /
tmpfs                 1.8G     0  1.8G   0% /lib/init/rw
varrun                1.8G   92K  1.8G   1% /var/run
varlock               1.8G     0  1.8G   0% /var/lock
udev                  1.8G  168K  1.8G   1% /dev
tmpfs                 1.8G     0  1.8G   0% /dev/shm
lrm                   1.8G  2.5M  1.8G   1% /lib/modules/2.6.28-19-generic/volatile
/dev/sda5              76M   20M   53M  27% /boot
/dev/sda8             220G  7.4G  202G   4% /home
/dev/sda7             4.6G  4.4G     0 100% /var

Thanks 谢谢

/dev/sda7             4.6G  4.4G     0 100% /var
varrun                1.8G   92K  1.8G   1% /var/run
varlock               1.8G     0  1.8G   0% /var/lock

I re-arranged your df -h output a little and trimmed it to the most meaningful lines. 我重新整理了您的df -h输出,并将其修整为最有意义的行。

You need to remove content in /var/ that is not in /var/run or /var/lock . 您需要删除内容/var/不是/var/run/var/lock A very fast way to free up a giant pile of free space on Debian-derived systems (including Ubuntu) is to run apt-get autoclean -- this will remove old packages from /var/cache/apt/archives/ . 在Debian衍生的系统(包括Ubuntu)上释放大量可用空间的快速方法是运行apt-get autoclean这将从/var/cache/apt/archives/删除旧软件包。 apt-get clean will free up even more space by removing all packages from that directory. apt-get clean通过从该目录中删除所有软件包来释放更多空间。 (These packages are kept around for your troubleshooting.) If you're not sure which to run, apt-get clean is my suggestion -- you'll almost never need those packages anyway. (这些软件包会保留在您的位置以便进行故障排除。)如果您不确定要运行哪个软件包,我建议您采用apt-get clean clean-几乎永远不需要这些软件包。

But that's not a long-term solution to your problem. 但这不是您问题的长期解决方案。 You should probably store your SQL databases in /home instead. 您可能应该将SQL数据库存储在/home You have 202 gigabytes free there and you probably have a backup solution of some sort in place on your /home partition -- right? 您那里有202 GB的可用空间, 并且您的/home分区上可能有某种备份解决方案-对吗? -- that you might not have thought to back up from /var/ . -您可能没有想到要从/var/备份。 Make a new directory in /home/ for your SQL databases, make it owned by the user and group accounts for your SQL server, move your databases, and configure the database server to use the new locations. /home/为您的SQL数据库创建一个新目录,使其归您的SQL服务器的用户帐户和组帐户所有,移动数据库,并将数据库服务器配置为使用新位置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Linux上,如何确定哪些页面驻留? - On Linux, how do you determine which individual pages are resident? 为什么我必须在 Live-Linux 发行版中删除 windows 分区+应该删除哪个分区? - Why do I have to be in Live-Linux distro to delete windows partition + which partition should be deleted? 在Linux(Ubuntu)中,当我看到“没有这样的文件或目录”时,如何确定找不到哪个特定文件 - In Linux (Ubuntu), how do I determine which specific file was not found when I see “No such file or directory” 你如何知道 Ubuntu 上安装了哪个版本的 GTK+? - How do you find out which version of GTK+ is installed on Ubuntu? 您建议使用哪种方法在 Linux 中读取多播流? - Which method do you suggest for reading multicast stream in Linux? 如何找到最近10天内被修改但不在bash终端上的“ CVS”,“ build”或“ classes”文件夹中的文件? - How do I locate files which were modified within the last 10 days but and NOT in a “CVS”, “build” or “classes” folder on a bash terminal? 如何找到可执行文件所在的目录,显示出来,不重复? Linux - How to find the directories in which the executable files are located, display them and so that they do not repeat? Linux 如何使用linux命令列出包含特定字符串的文件 - How to list files which contain specific string using linux commands 如何在Linux上创建支持替换/删除文件的存档? - How to create archives on Linux which support replacing/deleting files? 如何使用Linux下属于子用户命名空间的文件? - How to work with files which belong to the subuser namespace under Linux?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM