哪个版本的Linux占硬盘空间最小?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了哪个版本的Linux占硬盘空间最小?相关的知识,希望对你有一定的参考价值。

近日搞到一本老笔记本,硬盘就4G,打算装个Linux玩玩,但考虑到硬盘实在太小,不知道该装哪个版本的,麻烦知道的给推荐一个,谢谢!

还没有具体看过,呵呵.不过给你贴份我的收藏.
主流服务器UNIX操作系统用户帐号的设置
账号设置 HP-UX FreeBSD Solaris (SPARC)
密码文件 /etc/passwd
/tcb/files/auth/r/root /etc/passwd
/etc/master.passwd /etc/passwd
/etc/shadow
组文件 /etc/group
/etc/logingroup /etc/group /etc/group
允许最大用户ID 2147483647 65535 2147483647
允许远程登录的用户文件设置 /etc/securetty
console /etc/ttys
secure /etc/default/login
CONSOLE=/dev/console
Nobody的UID -2 65534 60001 & 65534(nobody4)
Nobody的GID -2(nogroup) 65534 60002 & 65534(nogroup)
找回ROOT密码 >boot
Interact with IPL ? Y
ISL>hpux -iS
passwd root ok boot -s
passwd root boot cdrom -s
mkdir /tmp/a
mount /dev/c0t0d0s0 /tmp/a
vi /tmp/a/etc/shadow
创建新用户 useradd adduser Useradd
删除用户 userdel rmuser Userdel
列出用户 logins Logins
修改用户账号 usermod Usermod

账号设置 AIX Linux( RedHat )
密码文件 /etc/passwd
/etc/security/passwd /etc/passwd
/etc/shadow
组文件 /etc/group
/etc/security/group /etc/group
允许最大用户ID 4294967295 65535
允许远程登录的用户文件设置 /etc/security/user
rlogin=true /etc/securetty
ttyp1
Nobody的UID 4294967294 99
Nobody的GID 4294967294 99
找回ROOT密码 Boot from CD/Tape
Installation/Maintenance
Start Limited Shell
getrootfs hdisk0
vi /etc/security/passwd lilo
control-x
linux S
passwd root

grub
c
kernel vmlinuz-2.4.9-13 single ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot
passwd root
创建新用户 mkuser Useradd
删除用户 rmuser Userdel
列出用户 lsuser -f ALL
修改用户账号 chuser -a usermod

主流服务器UNIX操作系统目录结构对比
Directory Mappings AIX FreeBSD HP-UX
Root filesystem / /dev/hd4 / /dev/ad0s1a / /dev/vg00/lvol1
Home Directory /home /dev/hd1 /home /dev/vg00/lvol4
/tmp /dev/hd3 /tmp /dev/vg00/lvol6
/usr /dev/hd2 /usr /dev/ad0s1f /usr /dev/vg00/lvol7
/var /dev/hd9var /var /dev/ad0s1e /var /dev/vg00/lvol8
Sample configuration files - /usr/newconfig

Directory Mappings Linux( RedHat ) Solaris Tru64
Root filesystem / /dev/sda1 / /dev/vx/dsk/rootvol / /dev/rz0a
Home Directory /export/home dev/vx/dsk/home
/tmp dev/vx/dsk/swapvol
/usr /usr /dev/rz0g
/var
Sample configuration files

主流服务器UNIX操作系统常用命令
General Commands AIX FreeBSD HP-UX Linux(RedHat) Solaris Tru64
Unique host ID Hostid uname -i hostid hostid hostid
Administrator Smit Sam linuxconf admintool netconfig
Performance monitor Topas(有过top)
monitor top Top
glance Top top top
System activity reporter Sar sa Sar sar
Virtual Memory statistics Vmstat vmstat vmstat vmstat vmstat vmstat
I/O statistics iostat iostat iostat iostat iostat
Error logs alog -o -t boot
errpt dmesg dmesg Dmesg dmesg uerf -R -o full
Physical RAM 1M TB 4TB 64GB>2.3.24 16TB 4TB
Shared Memory 64K TB 8TB sysctl kernel.shmmax
Process Data Space 384K TB 4TB 900 MB
Swap device /dev/hd6 /dev/ad0s1b /dev/vg00/lvol2 /dev/sda2 /dev/vx/dsk/swapvol /dev/rz0b
Swap file type /etc/swapspaces swap swap partition type 82 swap raw
Display swap size lsps –a swapinfo swapinfo -a Free swap -l swapon -s
Activate Swap swapon -a swapon -a swapon -a swapon -a swap -a swapon -a

主流服务器UNIX操作系统打印机、TCP/IP设置
Printers AIX FreeBSD HP-UX
Printer Queues /etc/qconfig /var/spool/print /etc/lp/interface/*
Stop LP stopsrc -s lpd lpshut
Start LP startsrc -s lpd Lpd lpsched
Submit print jobs enq
lp
lpr
qprt Lp lp
LP statistics enq -A
lpq
lpstat
qchk Lpq lpstat
Remove print jobs cancel
lprm
qcan
enq –x Cancel
lprm cancel
Add printer queue smit mkpq lpadmin -p pq
Remove Printer Q smit rmpq lpadmin -x pq
Make default Prt export LPDEST="pq" lpadmin -d pq
TCP/IP AIX FreeBSD HP-UX
Network IP configuration lsattr -E -l inet0 /etc/rc.conf /etc/rc.config.d/netconf
Hosts IP addresses /etc/hosts /etc/hosts /etc/hosts
Name service switch /etc/netsvc.conf /etc/host.conf /etc/nsswitch.conf
Network parameters no –a Sysctl ndd -h
Routing daemon Gated Routed gated
NIC Configurations ifconfig –a ifconfig -a lanscan -v
Secondary IP Addr ifconfig en0 alias IP ifconfig xl0 alias IP ifconfig lan0:1 IP
(solaris also)
Login prompt HERALD @
/etc/security/login.cfg telnetd –b /etc/issue
Increase the # of pseudo-terminals odmget -q "attribute=num and uniquetype=pty/pty/pty" PdAt | sed "s/0-64/0-512/" |
odmchange -q "attribute=num and uniquetype=pty/pty/pty" -o PdAt
chdev -l pty0 -anum=256 -P
reboot rebuild your kernel with these new values NPTY=#
NSTRPY=#
reboot
insf -d ptys -n #
insf -d ptym -n #
insf -d pts -s # -e -v

Maximum # of ptys 512 MAXUSERS
Remote Shell Remsh
rsh Rsh remsh
YP/NIS service binder /usr/lib/netsvc/yp/ypbind /usr/sbin/ypbind /usr/lib/netsvc/yp/ypbind

主流服务器UNIX操作系统打印机、TCP/IP设置 续
Printers Linux (Redhat) Solaris (SPARC) Tru64
Printer Queues /var/spool/lpd/lp/* /etc/lp/interfaces/* /usr/spool/lpd
Stop LP /etc/init.d/lpd stop /usr/lib/lp/lpshut /sbin/init.d/lpd stop
Start LP /etc/init.d/lpd start /usr/lib/lp/lpsched /sbin/init.d/lpd start
Submit print jobs Lpr Lp
lpr Lp
lpr
LP statistics Lpq Lpstat Lpstat
Remove print jobs Lprm Cancel
lprm cancel
lprm
Add printer queue Printtool lpadmin -p pq Lprsetup
Remove Printer Q lpadmin -x pq Lprsetup
Make default Prt lpadmin -d pq export PRINTER="lp"
TCP/IP Linux( RedHat ) Solaris (SPARC) Tru64
Network IP configuration /etc/sysconfig/network-scripts/ /etc/hostname.*
/etc/inet/*
/etc/defaultrouter /etc/rc.config
Hosts IP addresses /etc/hosts /etc/inet/hosts /etc/hosts
Name service switch /etc/nsswitch.conf /etc/nsswitch.conf /etc/svc.conf
Network parameters sysctl -a | grep net Ndd /dev/[tcp|ip] ?
Routing daemon routed in.routed routed
NIC Configurations ifconfig -a ifconfig –a ifconfig -a
Secondary IP Addr modprobe ip_alias
ifconfig eth0:1 IP ifconfig hme0:1 IP up ifconfig ln0 alias
Login prompt /etc/issue BANNER @
/etc/default/telnetd /etc/issue
Increase the # of pseudo-terminals cd /dev
./MAKEDEV -v pty /etc/system
set pt_cnt = # SYSV
set npty = # BSD
/etc/iu.ap
ptsl 0 # ldterm ttcompat
halt
boot –r cd /dev
./MAKEDEV PTY_1
Maximum # of ptys 256 176 BSD
3000 SYSV 8192
Remote Shell rsh Rsh rsh
YP/NIS service binder /sbin/ypbind /usr/lib/netsvc/yp/ypbind /usr/sbin/ypbin

主流服务器UNIX操作系统系统文件
System Files AIX FreeBSD HP-UX
NFS exported /etc/exports /etc/exports /etc/exports
NFS Client mounted directories /etc/xtab /etc/xtab
Max File System 128 GB 128 GB
Max File Size 64 GB 128 GB
Max # File Descriptors 64 K 60~ K

System Files Linux (RedHat) Solaris Tru64
NFS exported /etc/exports /etc/dfs/dfstab
/etc/dfs/sharetab /etc/exports
NFS Client mounted directories /var/lib/nfs/xtab /etc/rmtab /var/adm/mountdtab
Max File System 2 TB 1 TB
8000 TB vxfs 128 GB <= 3.2G
512 GB >= 4.0
16 TB advfs
Max File Size 2 GB 512B block size
8192 GB 8KB block size 1 TB
2 GB =<2.5.1 128 GB <= 3.2G
512 GB >= 4.0
16 TB advfs
Max # File Descriptors sysctl fs.file-max 64 K 64 K

主流服务器UNIX操作系统磁盘与逻辑卷命令
DISK/LVM Commands AIX FreeBSD HP-UX
Filesystem table /etc/filesystems /etc/fstab /etc/fstab
Free disk blocks df -k df -k Bdf
Device listing lsdev -C /sbin/ioscan
Disk information bootinfo -s hdisk# fdisk -v ad0 diskinfo /dev/rdsk/c#t#d#
Disk Label lspv -l hdisk# disklabel ad0 pvdisplay -v /dev/dsk/C#t#d#
LVM Concepts Partition sub disk logical extents
Volume Volume logical volume
Plex
Volume group volume group
Journal Filesystem type jfs Vxfs
Default volume group /dev/rootvg /dev/vg00
Display volume group lsvg -l rootvg vgdisplay -v vg00
Modify physical volume chpv Pvchange
Prepare physical disk mkdev -c disk -l hdisk# pvcreate
List physical volume lspv vinum ld pvdisplay
Remove disk from volume group reducevg vgreduce
Move logical volumes to another physical volumes migratepv vinum move -f drive object pvmove
Create volume group mkvg vgcreate
Remove volume group vgremove
Volume group availability chvg
varyonvg
varyoffvg vgchange
Restore volume group vgcfgrestore
Exports volume group exportvg vgexport
Imports volume group importvg vgimport
Volume group listing lsvg Vgscan 是一样的么?
Change logical volume characteristics chlv lvchange
List logical volume lslv vinum lv lvdisplay
Make logical volume mklv lvcreate
Extend logical volume extendlv lvextend
Reduce logical volume AIX reduce LV Lvreduce 如何用?
Remove logical volume rmlv vinum rm vol lvremove
Prepare boot volumes bootlist -m normal lvlnboot
Remove boot volumes lvrmboot
Extend File system chfs -a size=# /mt extendfs /dev/vg00/lvol8
fsadm -F vxfs -b LE * 1024 /mt
Reduce/Split mirrors rmlvcopy lvsplit
Merge mirrors lvmerge
Create mirrors mklv -c 2 vinum mirror drive lvcreate -m 1
Add mirrors mklvcopy lv 2 lvextend -m 1
Create striped volumes mklv -u 3 -S 64K vinum stripe drive lvcreate -i 3 -I 64
System recovery tape mksysb -i /dev/rmt0 /opt/ignite/bin/make_recovery
Backup savevg -i rootvg vinum saveconfig fbackup
Restore restvg frecover

主流服务器UNIX操作系统磁盘与逻辑卷命令 续
DISK/LVM Commands Linux (RedHat) Solaris (SPARC) Tru64
Filesystem table /etc/fstab /etc/vfstab /etc/fstab
Free disk blocks df -k df –k df -k
Device listing cat /proc/devices Sysdef
Disk information cat /proc/scsi/scsi0/sda/model format -d c#t#d#
format>current
format>inquiry file /dev/rrz0c
Disk Label fdisk -l Prtvtoc disklabel -p rz0
LVM Concepts logical extents sub disk sub disk
logical volume Volume Volume
Plex Plex
volume group disk group disk group
Journal Filesystem type ext2 居然是jfs的? Vxfs Advfs 居然是jfs的?
Default volume group /dev/vx/dsk/rootdg
居然有 vg? /dev/vol/rootdg
居然有 vg?
Display volume group vgdisplay -v vxprint -l -g rootdg volprint -l -g rootdg
Modify physical volume pvchange
Prepare physical disk pvcreate vxdiskadd voldiskadd
List physical volume pvdisplay vxprint -dl volprint -dl
Remove disk from volume group vgreduce vxdg rmdisk voldg rmdisk
Move logical volumes to another physical volumes pvmove vxassist move volassist move
Create volume group vgcreate vxdg init voldg init
Remove volume group vgremove
Volume group availability vgchange
Restore volume group vgcfgrestore
Exports volume group vgexport vxdg deport voldg deport
Imports volume group vgimport vxdg import voldg import
Volume group listing vgscan
Change logical volume characteristics lvchange vxedit set voledit set
List logical volume lvdisplay vxprint -vl volprint -vl
Make logical volume lvcreate vxassist make volassist make
Extend logical volume lvextend vxassist growto volassist growto
Reduce logical volume lvreduce vxassist shrinkto volassist shrinkto
Remove logical volume lvremove vxedit rm voledit -g rootdg -rf rm vol1
Prepare boot volumes lilo vxbootsetup
Remove boot volumes
Extend File system resize2fs vxva
mkfs -M
Reduce/Split mirrors lvsplit
Merge mirrors lvmerge
Create mirrors vxassist mirror volassist make vol 100mb mirror=true
Add mirrors
Create striped volumes lvcreate -i 3 -I 64 vxassist make vol 100mb layout=raid5 volassist make vol 100mb layout=stripe
System recovery tape /usr/sys/bin/btcreate
Backup tar cvf /dev/rst0 / ufsdump vdump
Restore tar xvf /dev/rst0
这一列对不对? ufsrestore vrestore

主流服务器UNIX操作系统安装与卸载
Software AIX FreeBSD HP-UX
Install Software installp -a pkg_add swinstall
Uninstall software installp -u pkg_delete swremove
List installed software lslpp -L all pkg_info -a swlist
Verify installed software lppchk -v swlist -l fileset -a state
List all files lslpp -f fileset pkg_info -L package swlist -l file fileset
List installed patches instfix -i swlist -l patch
what /stand/vmunix
Package owner lslpp -w path swlist -l file | grep path
SW Directory /usr/lpp /var/db/pkg /var/adm/sw/

Software Linux (RedHat) Solaris (SPARC) Tru64
Install Software rpm -i package pkgadd setld -l
Uninstall software rpm -e package pkgrm setld -d
List installed software rpm -qa pkginfo setld -i
Verify installed software rpm -V package pkginfo -i
pkginfo -p setld -v
List all files rpm -ql package pkgchk -l package setld -i package
List installed patches patchadd -p dupatch -track -type patch
Package owner rpm -qf file pkgchk -l -p path
SW Directory /var/lib/rpm /var/sadm /var/adm/smlogs

主流服务器UNIX操作系统技术支持信息
Links AIX HP-UX Linux (RedHat)
FAQ AIX-FAQ
HP-UX FAQ 这个和我知道的一个? LINUX FAQ

Online Manual AIX 4.3 Books
HP-UX 11.00 Collection
Linux Documentation Project

Technical Support RS/6000 TechSupport
IT Resource Center
Red Hat support

Phone Number 1-800-CALL-AIX 1-800-633-3600 1-888-REDHAT1
Free Software Bull
HP-UX Ports
Linux Software Map

Certification www.ibm.com
education.hp.com
RHCE

Links FreeBSD Solaris (SPARC) Tru64
FAQ FreeBSD FAQ
Solaris 2 FAQ
Tru64 FAQ

Online Manual FreeBSD Hand Book
Solaris 7 Documentation
Tru64 Documents

Technical Support SunSolve
Alpha Systems Support

Phone Number 1-800-USA-4SUN
Free Software FreeBSD Primary Site
Sun Freeware
Tru64 Demos, Shareware & Freeware

Certification suned.sun.com
ASE Information

主流服务器UNIX操作系统其它命令
MISC AIX FreeBSD HP-UX
Startup script /etc/rc /etc/rc /sbin/rc
Kernel /usr/lib/boot/unix_up /kernel /stand/vmunix
Kernel Parameters lsattr -E -l sys0 sysctl -a sysdef kmtune kmsystem
Reconfigure the kernel
chdev -l sys0 -a cd /sys/i386/conf
vi KERNEL
config KERNEL
cd ../../compile\
/KERNEL
make depend
make
make install cd /stand/build\
/usr/lbin/sysadm\
/system_prep -v -s system
vi system
mk_kernel -s system
cd /stand
mv system system.prev
mv vmunix vmunix.prev
mv dlkm dlkm.prev
mv /stand/build\
/system system
kmupdate /stand/build\
/vmunix_test
List modules genkex kldstat kmadmin –s
Load module kldload kmadmin –L
Unload module kldunload kmadmin –U
Initialize system install_assist /stand/sysinstall set_parms initial
Physical RAM bootinfo -r sysctl hw.physmem grep -i Physical\ /var/adm/syslog\
/syslog.log
Kernel Bits bootinfo -k getconf KERNEL_BITS
Crash utility Crash crash Adb
Trace System Calls Syscalls truss tusc

Machine model uname -m
bootinfo -m uname -m model
uname -m
OS Level Oslevel uname -r uname -r
Run Level who –r who -r
Core dump files /var/adm/ras /var/adm/crash
Boot single user Key on service mode/F4
Boot from CD/Tape
Select Maintenance
Limited function Shell ok boot –s >boot
Interact with IPL ? Y
ISL>hpux -iS
Maintenance mode ok boot –as >boot
Interact with IPL ? Y
ISL>hpux -lm
Interrupt Key control-B
Return to console Co
Timezone Management /etc/environment
/etc/profile /etc/localtime /etc/TIMEZONE
NTP Daemon
如何用它? /etc/ntp.conf
startsrc -s xntpd /etc/rc.conf xntpd enable="YES"
/etc/rc.network /etc/rc.config.d\
/netdaemons
/sbin/init.d/xntpd
主流服务器UNIX操作系统其它命令 续
MISC Linux (RedHat) Solaris (SPARC) Tru64
Startup script /etc/rc.d/rc /sbin/init.d /sbin/init.d
Kernel /boot/vmlinuz /kernel/genunix /vmunix
Kernel Parameters sysctl -a sysdef –I sysconfig dxkerneltuner
Reconfigure the kernel cd /usr/src/linux
make mrproper
make menuconfig
make dep;clean;bzImage;install
make modules
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz
mkinitrd /boot/initrd-2.4.img 2.4
vi /etc/lilo.conf
lilo vi /etc/system
reboot doconfig
List modules lsmod modinfo
Load module insmod modload
Unload module rmmod modunload
Initialize system netconf sys-unconfig netsetup
Physical RAM free prtconf uerf | grep memory
Kernel Bits getconf WORD_BIT isainfo -kv 64
Crash utility lcrash
crash kdbx
Trace System Calls strace truss trace

Machine model uname -m uname -imp uname -p
OS Level uname -r uname -r sizer -v
Run Level runlevel who -r who -r
Core dump files /var/crash/`uname -n`
Boot single user lilo
control-x
linux S

grub
c
kernel vmlinuz-2.4.9-13 single ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot ok boot -s >>> boot -fl s
Maintenance mode ok boot -as
Interrupt Key Stop-A control-P
Return to console ok go
Timezone Management /etc/sysconfig/clock /etc/TIMEZONE
/etc/default/init /etc/svid3_tz
timezone
NTP Daemon /etc/ntp.conf
/etc/rc.d/init.d/xntpd /etc/inet/ntp.conf
/etc/init.d/xntpd rcmgr set XNTPD_CONF YES
/sbin/init.d/xntpd

主流服务器UNIX操作系统设备管理
Devices AIX FreeBSD HP-UX
Devices /dev /dev /dev
Install devices for attached peripherals cfgmgr –v /dev/MAKEDEV insf -e
Remove device rmdev –l rmsf
Device drivers Lscfg lsdev
CPU lsdev -Cc processor sysctl hw.model ioscan -fnC processor
List Terminal lsdev -Cc tty ioscan -fnC tty
Diagnostics Diag pciconf -l Stm
Whole Disk /dev/hdisk# /dev/ad0s1c /dev/dsk/c#t#d0
CDROM /dev/cd0 /dev/acd0c /dev/dsk/c#t2d0
CDROM file type Cdrfs cd9660 Cdfs
Rewinding tape drive /dev/rmt0 /dev/rwt0d /dev/rmt/0m
Floppy drive /dev/rfd0 /dev/fd0 -
Non-rewinding tape drive /dev/rmt0.1 /dev/nrwt0d /dev/rmt/0mn

Devices Linux (RedHat) Solaris (SPARC) Tru64
Devices /dev /devices /dev
Install devices for attached peripherals /dev/MAKEDEV drvconfig
devlinks
disks
tapes
ports scu scan edt
scsimgr -scan_all
Remove device rem_drv
Device drivers prtconf -D
CPU cat /proc/cpuinfo psrinfo -v psrinfo -v
List Terminal pmadm -l
Diagnostics /usr/platform/`uname -m`/
sbin/prtdiag
ok test-all
/opt/SUNWvts/bin/sunvts
Whole Disk /dev/sda /dev/c#t#d0s2 /dev/rz0c
CDROM /dev/cdrom /dev/dsk/c#t6d0s2 /dev/rz3c
CDROM file type iso9660 hsfs cdfs
Rewinding tape drive /dev/rst0 c 9 0 /dev/rmt/0 /dev/rmt0
Floppy drive /dev/fd0 /dev/diskette /dev/fd0c
Non-rewinding tape drive /dev/nrst0 c 9 128 /dev/rmt/0n /dev/nrmt0
参考技术A 这要看你装那些服务了哦,在安装Linux的最后会又一个提示,看你需要哪些服务,安装的服务越少系统资源占用的就越少,用RedHat Linux9.0如果只装几个必要服务,只要10几分钟就可以装完,所以建议你用9.0的试试。本回答被提问者采纳 参考技术B 硬盘不成问题,关键是老本本有没有光驱,如果没有,要拆硬盘,那就比较麻烦了。

Linux 系统(Centos版本)磁盘空间占满的解决办法。

这两天 ,服务器借给了朋友 搭建  三端合一的 游戏,结果没弄成。

还给我服务器的时候,卧槽!!! ,40G的硬盘,使用率 百分百,这是放种子了???

算了 ,自己借出去的服务器,含着泪也要修好。

本来是准备重装系统 搞定的。想想,服务器用的久了,服务器的内容也多了,一个SVN版本控制器的内容,就让你舍不得重装了。

还是查查资料,想想其他办法吧。

解决开始:

先命令查一查磁盘,使用率吧。别是宝塔面板的问题。那也不是不可能。

1 [root@ecs-linux-byx /]# df -l
2 文件系统          1K-块     已用    可用 已用% 挂载点
3 devtmpfs        1929524        0 1929524    0% /dev
4 tmpfs           1939936      116 1939820    1% /dev/shm
5 tmpfs           1939936     8736 1931200    1% /run
6 tmpfs           1939936        0 1939936    0% /sys/fs/cgroup
7 /dev/vda1      41152736 39892280       0  100% /
8 tmpfs            387988        0  387988    0% /run/user/0

 

没办法穷人只配有一块磁盘,看来确实是被占满了。那就再看看是哪文件夹的占用高吧,只能一层一层逐层去查找了。

其中,异常的占有率,我都标记 黄色了~

 1 [root@ecs-linux-byx /]# du -h --max-depth=1
 2 200M    ./CloudResetPwdUpdateAgent
 3 242M    ./boot
 4 925M    ./home
 5 963M    ./var
 6 13G     ./www
 7 38M     ./etc
 8 16K     ./lost+found
 9 120K    ./dev
10 0       ./sys
11 2.3M    ./CloudrResetPwdAgent
12 4.0K    ./srv
13 0       ./proc
14 4.0K    ./opt
15 4.0K    ./media
16 5.6M    ./mnt
17 8.0K    ./patch
18 4.4G    ./usr
19 11G     ./root
20 8.6M    ./run
21 136K    ./tmp
22 30G     .

 

可以看出是 www文件夹root  文件夹 占用率很高。现在需要优化这两个文件夹就可以了。

一、 进入到root文件夹,发现log日志文件居然占了11个G!!!

不难猜出,我这朋友,游戏没搭建成,但是把人家游戏的日志文件,拷贝的还是挺齐全的.......

这个,直接 rm -rf 不用犹豫。

[root@ecs-linux-byx /]# cd /root
[root@ecs-linux-byx ~]# du -h --max-depth=1
48K     ./.subversion
8.0K    ./.pki
8.0K    ./.ssh
276K    ./.cache
8.0K    ./.pip
8.0K    ./.oracle_jre_usage
16K     ./.aspnet
11G     ./log
11G     .

 

二、进入到www文件夹,发现虽然这个文件夹的占用率是挺高的,但是,下面的文件却占有率不高,这啥情况,去后台看看呗。

[root@ecs-linux-byx ~]# cd /www
[root@ecs-linux-byx www]# du -h --max-depth=1
39M     ./wwwroot
12M     ./wwwlogs
2.2G    ./server
1.2M    ./backup
6.4M    ./Recycle_bin
13G     .

 

发现是,可能是嫌服务器 4核满足不了要求。又自己弄了一个 10G的虚拟内存。

这个,没用的必要,直接删掉就好了。

 

 

删除不了的,可以去宝塔面板里面 的 Linux工具箱。设置成0MB 确定,取消掉就可以了。

 

 

清理完,服务器就又有20多个G,又能多蹦跶几天了,耶~~~

 

 

 

希望可以帮助到你。

by不言谢

 

以上是关于哪个版本的Linux占硬盘空间最小?的主要内容,如果未能解决你的问题,请参考以下文章

linux 查看硬盘使用情况

为啥在Linux上删除大容量文件后硬盘空间大小还不变???

对于已预先分配的虚拟机硬盘,如何压缩或者减小其所占空间

为什么硬盘明明还有空间,linux却说硬盘空间不足?

为啥在Linux上删除大容量文件后硬盘空间大小还不变

wsl所占硬盘空间过大 虚拟机删除文件后硬盘空间不减少