设为首页 - 加入收藏 焦点技术网
热搜:java
当前位置:首页 >

关于安装linux时要怎么分区的考虑的参考方式?

2014-11-19 14:15:00.0 linux 分区 挂载点 安装  
导读:本文qidizi给大家介绍 关于安装linux时要怎么分区的考虑的参考方式?。对于使用最小化安装的centos7目录列表,注意链接方式的目录会在统计占用空间时不会算入的;看看占用空间(链接目录不会出。。。

对于使用最小化安装的centos7目录列表,注意链接方式的目录会在统计占用空间时不会算入的;


看看占用空间(链接目录不会出现)



ok到这里,是否你知道每一个大概多少足够了?


这里再看眼使用了几年的普通线上web服务器的目录(ubuntu的)



看看占用空间情况(有mysql,nginx,php)

du -h -d 1796K    ./run9.4M    ./etc4.0K    ./opt1.2G    ./usr640M    ./lib4.0K    ./media4.0K    ./cdrom172K    ./build5.0M    ./tmp4.0K    ./mnt8.0K    ./srv4.0K    ./lib649.8M    ./bin272K    ./rootdu: cannot access â./proc/2121/task/2121/fd/4â: No such file or directorydu: cannot access â./proc/2121/task/2121/fdinfo/4â: No such file or directorydu: cannot access â./proc/2121/fd/4â: No such file or directorydu: cannot access â./proc/2121/fdinfo/4â: No such file or directorydu: cannot access â./proc/23692/task/23692/fd/26â: No such file or directorydu: cannot access â./proc/23692/task/23692/fd/35â: No such file or directorydu: cannot access â./proc/23692/task/23692/fd/39â: No such file or directory0       ./proc11M     ./sbin16K     ./lost+found264K    ./home86M     ./boot328G    ./var4.0K    ./dev0       ./sys330G    .
再看看var中的占用情况(mysql 的data是放在lib中,www是网站与一些相关备份)

lltotal 72drwxr-xr-x 15 root root      4096 Sep 23 02:50 ./drwxr-xr-x 24 root root      4096 Sep 23 02:45 ../drwxrwxrwx  3 root root      4096 Sep 25 06:33 backups/drwxr-xr-x 11 root root      4096 Sep 24 19:04 cache/drwxrwsrwt  2 root whoopsie  4096 Nov 14 06:25 crash/drwxr-xr-x 47 root root      4096 Sep 24 19:02 lib/drwxrwsr-x  2 root staff     4096 Jan 21  2011 local/lrwxrwxrwx  1 root root         9 Sep 23 02:50 lock -> /run/lock/drwxrwxr-x 15 root syslog    4096 Nov 19 06:47 log/drwx------  2 root root     16384 May 21  2011 lost+found/drwxrwsr-x  2 root mail      4096 May 21  2011 mail/drwxrwsrwt  2 root whoopsie  4096 Sep 23 02:44 metrics/drwxr-xr-x  2 root root      4096 May 21  2011 opt/lrwxrwxrwx  1 root root         4 Sep 23 02:50 run -> /run/drwxr-xr-x  5 root root      4096 Sep 23 04:01 spool/drwxrwxrwt  2 root root      4096 Sep 23 03:04 tmp/drwxr-xr-x 12 root root      4096 Nov 13 10:30 www/
占用空间
/var# du -h -d 116G     ./lib9.9G    ./log41G     ./backups4.0K    ./opt4.0K    ./local36K     ./spool16K     ./lost+found4.0K    ./mail17M     ./crash639M    ./cache4.0K    ./metrics262G    ./www4.0K    ./tmp328G    .

var/www就没有什么好多说了.自己决定的

看看除了mysql外,其它东西占用多

/var# du -h -d 1 /var/lib/12M     /var/lib/php54.0K    /var/lib/misc15G     /var/lib/mysql8.0K    /var/lib/update-manager8.0K    /var/lib/sudo8.0K    /var/lib/ureadahead496K    /var/lib/usbutils20K     /var/lib/update-notifier74M     /var/lib/mlocate12K     /var/lib/sgml-base12K     /var/lib/locales140K    /var/lib/ucf8.0K    /var/lib/vim4.0K    /var/lib/update-rc.d20K     /var/lib/initramfs-tools14M     /var/lib/aptitude52K     /var/lib/belocs4.0K    /var/lib/initscripts4.0K    /var/lib/dhcp4.0K    /var/lib/ubuntu-release-upgrader32K     /var/lib/apache24.0K    /var/lib/git8.0K    /var/lib/logrotate4.0K    /var/lib/landscape4.0K    /var/lib/os-prober4.0M    /var/lib/nginx12K     /var/lib/AccountsService24K     /var/lib/libxml-sax-perl12K     /var/lib/xml-core8.0K    /var/lib/dbus3.7M    /var/lib/apt-xapian-index4.0K    /var/lib/ntpdate8.0K    /var/lib/apparmor4.0K    /var/lib/python48K     /var/lib/nssdb32M     /var/lib/dpkg146M    /var/lib/apt8.0K    /var/lib/pycentral4.0K    /var/lib/plymouth4.0K    /var/lib/libuuid28K     /var/lib/polkit-128K     /var/lib/pam8.0K    /var/lib/urandom32K     /var/lib/systemd4.0K    /var/lib/insserv16G     /var/lib/


再看眼没用上的阿里去的服务器

[root@lsqvps /]# lltotal 96dr-xr-xr-x.  2 root root  4096 Sep 23 15:55 bindr-xr-xr-x.  4 root root  4096 Jul 30  2013 bootdrwxr-xr-x   5 root root  4096 Sep 24 17:20 datadrwxr-xr-x  15 root root  3220 Oct  9 08:39 devdrwxr-xr-x. 61 root root  4096 Oct  9 08:39 etcdrwxr-xr-x.  4 root root  4096 Sep 24 17:17 homedr-xr-xr-x.  8 root root  4096 Mar 14  2014 libdr-xr-xr-x.  7 root root 12288 Sep 23 15:54 lib64drwx------.  2 root root 16384 Dec 17  2012 lost+founddrwxr-xr-x.  2 root root  4096 Sep 23  2011 mediadrwxr-xr-x.  2 root root  4096 Sep 23  2011 mntdrwxr-xr-x.  2 root root  4096 Sep 23  2011 optdr-xr-xr-x  87 root root     0 Oct  9 16:39 procdr-xr-x---.  5 root root  4096 Sep 24 16:56 rootdr-xr-xr-x.  2 root root  4096 Sep 23 15:55 sbindrwxr-xr-x.  2 root root  4096 Dec 17  2012 selinuxdrwxr-xr-x.  2 root root  4096 Sep 23  2011 srvdrwxr-xr-x  13 root root     0 Oct  9 16:39 sysdrwxrwxrwt.  3 root root  4096 Oct  9 08:39 tmpdrwxr-xr-x. 13 root root  4096 Dec 17  2012 usrdrwxr-xr-x. 17 root root  4096 Sep 24 16:36 var

占用空间

[root@lsqvps /]# du -h --max-depth=1164K    ./dev5.8M    ./bin0       ./sys4.0K    ./mnt17M     ./lib6439M     ./boot245M    ./var278M    ./root778M    ./usr4.0K    ./selinux63M     ./data9.0M    ./sbindu: cannot access `./proc/8146/task/8146/fd/4': No such file or directorydu: cannot access `./proc/8146/task/8146/fdinfo/4': No such file or directorydu: cannot access `./proc/8146/fd/4': No such file or directorydu: cannot access `./proc/8146/fdinfo/4': No such file or directory0       ./proc6.6M    ./etc8.0K    ./tmp239M    ./lib4.0K    ./opt4.0K    ./media56K     ./home20K     ./lost+found4.0K    ./srv1.7G    .


ok.到这里是不是就可以知道怎么分了呢.

用得足够久.或是看看别人相同的作用服务器.这里就很容易知道怎么分了.

[root@lsqvps /]# du -h --max-depth=1164K    ./dev5.8M    ./bin0       ./sys4.0K    ./mnt17M     ./lib6439M     ./boot.

(编辑: qidizi)

网友评论
相关文章