[英]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.