๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์ฒœ์ฒœํžˆ, ๊พธ์ค€ํžˆ../LINUX

[LINUX] ๋””์Šคํฌ ๊ณต๊ฐ„ ๋ถ€์กฑ : ์–ด๋””์„œ ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š”์ง€ ์ฐพ๊ธฐ #du

by MIMI.L 2023. 12. 28.
๋ฐ˜์‘ํ˜•

Ubuntu 22.04 ์‚ฌ์šฉ์ค‘

์ตœ๊ทผ df -h ๋กœ ํ™•์ธ ์‹œ, ๋‚ด ์ƒ๊ฐ๋ณด๋‹ค ๋„ˆ๋ฌด ๋งŽ์€ ์šฉ๋Ÿ‰์„ ์‚ฌ์šฉ์ค‘์ด๋ผ ํ™•์ธ์ด ํ•„์š”ํ•จ

 

์ด์ „์— ์ผํ•  ๋•Œ , ๋น„์Šทํ•œ ์ผ์ด ์žˆ์—ˆ๋Š”๋ฐ ์›์ธ์ด ๋„์ปค์˜€๋˜๊ฒŒ ์ƒ๊ฐ๋‚ฌ๋Š”๋ฐ..

์šฐ์„  ํ™•์ธํ•ด๋ณด๊ณ ์ž ํ•จ

 

์•„๋ž˜๋Š” ํ˜„์žฌ ๋‚ด ๋””์Šคํฌ ์ƒํƒœ์ด๋‹ค.

๋ณ„๋กœ.. ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ์—†๋‹ค๊ณ  ์ƒ๊ฐํ•˜๊ณ , ์šฉ๋Ÿ‰์„ ๋„ˆ๋ฌด ๋งŽ์ด ์“ด ๋“ฏ ํ•ด์„œ ์ตœ๊ทผ์— ๋ฐ›์•„๋†จ๋˜ Docker image๋“ค๋„ ํ•„์š”ํ•œ๊ฒƒ๋งŒ Docker hub์— ์˜ฌ๋ ค๋‘๊ณ  ๋‹ค ์ง€์› ๋Š”๋ฐ๋„ 927GB๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ๋ณด์—ฌ์ง„๋‹ค.

 

์–ด๋””์„œ ์“ฐ๊ณ  ์žˆ๋Š”์ง€๋ฅผ ์šฐ์„  ์ฐพ์•„๋ณด๊ธฐ ์œ„ํ•ด / ์œ„์น˜์—์„œ du๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ™•์ธํ•ด๋ดค๋‹ค.

-h ์˜ต์…˜์€ ์šฉ๋Ÿ‰์„ ๋ณด๊ธฐ ํŽธํ•˜๊ฒŒ M(MB)/G(GB)/T(TB) ๋“ฑ.. ์œผ๋กœ ๋ณด์—ฌ์ค€๋‹ค

GB์ด์ƒ์ธ ๊ฒƒ๋“ค๋งŒ ๋ณด๊ธฐ ์œ„ํ•ด grep G๋ฅผ ์‚ฌ์šฉํ–ˆ๋‹ค

sudo du -h --max-depth=1 | grep G

>> ํ™•์ธ ์‹œ, ๋„์ปค๊ฐ€ ์›์ธ์ด ๋งž์•˜๋‹ค.

 

docker๋””๋ ‰ํ„ฐ๋ฆฌ๋Š” ์ผ๋ฐ˜ ์‚ฌ์šฉ์ž๋กœ๋Š” ๋“ค์–ด๊ฐˆ ์ˆ˜ ์—†์–ด์„œ su ๋ช…๋ น์„ ์‚ฌ์šฉํ•ด์„œ root๋กœ ์ „ํ™˜ ํ›„ docker ๋””๋ ‰ํ„ฐ๋ฆฌ์— ๋“ค์–ด๊ฐ€๋ด„

์—ฌ๊ธฐ์„œ ํ™•์ธํ•ด๋ณด๋‹ˆ overlay2 ๋””๋ ‰ํ„ฐ๋ฆฌ์—..

๋””๋ ‰ํ„ฐ๋ฆฌ ์•ˆ์—์„œ ๋™์ผํ•˜๊ฒŒ du๋กœ ํ™•์ธํ•ด๋ณด๋ฉด ์—ฌ๊ธฐ์„œ ๊ฐ๊ฐ์˜ ์ด๋ฏธ ์—„์ฒญ๋‚œ ์šฉ๋Ÿ‰์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

๋”๋ณด๊ธฐ
root@mimi:/var/lib/docker/overlay2# sudo du -h --max-depth=1 | grep G
2.6G	./8abc67k9orl0s97squeot5khv
2.7G	./wo7b0xn3fb4yw6pmvdyyk6glo
2.7G	./mxm4rfdl2z225in59peuoe0sb
29G	./ozudgg1xkjszvtt71nq4vnfam
4.2G	./aqy50fips8b9gp3eq5n4zf5sc
29G	./iqdqp0nq1zm88uleayb8mzgr3
29G	./03r1qln6sq5pos9uuzo4mn4lf
2.7G	./lgr496u1xv289dyi3l5rwoadr
2.6G	./7lpqx3uqramrbgr954i587ply
29G	./j84ttretjrq63211o5e6rg3u4
29G	./lz8agmfd06pwk48sia3vhj5fh
2.7G	./75kyrnrbban85vpt27rlsqa0z
29G	./8236oqp73fbrwggfcoe90c4qz
4.8G	./5v0daa6j3rongzu7yiwo0ykk1
29G	./c4tnvmao6zgtkj089xyr2qqs0
2.7G	./01pebony7zlcgnqyytyp58yth
29G	./5pihmp56oqbipdjgtl68rsmza
2.6G	./jxlils5s793if1nojoacerddk
2.6G	./95jrwz5abcl0lyve083jviufn
2.7G	./x6m2yz904i8qbk3xg8shquwb7
29G	./2b0u87vd41a05tab7c6xnuknc
29G	./ljp5l0x0thhp4u9fpafb1ztpv
29G	./gr1b9xd8u4901lfhs1rjws6yb
2.6G	./oymk3v15ri8sy7kr3qoqb45ca
2.7G	./mxcwviux1odg1mp8sxgi1bbs9
29G	./argzwtwrju2e4e5t0hvb598lj
2.7G	./gh9cgb10l1p7yibms9nmgagnk
2.7G	./w9mzhtdi0ltjl4zdr6e8ck3xi
29G	./yyh7zyhlvk6in4kzn5mup315d
29G	./ef5g4owdtdesnueq71e5g9ixl
2.7G	./tmnsisc49i2gtc0jbb3ptopzq
2.7G	./2ub9zlzxxsqcgq59k182w41n2
29G	./2nqtn1xxjmoavw9ap9byrpvbc
2.6G	./tahu013dpvuew6ue0ea5boxcq
29G	./i87hw14kn6x9ufob6hqaq7mwd
2.6G	./ot2eqbyfjm5lahiaeg4qh9faj
29G	./we9y9ze6kmzfenbil0w5zvi8j
2.7G	./q0dwvy6z2btwr6ltpejeohdfi
29G	./pl5ucp5i5rd3esz8w1rve5b2v
2.7G	./02b62cdl9rodhrh7b09366hw7
29G	./ce1vvo90avpnbnkzai1h2iw46
2.6G	./ubd4qoo454k55dqm5rnsmp5jf
2.7G	./04rawymkwxg9w6ht593j766xz
29G	./ta8gbm7mpc78k2i41dbts921u
2.7G	./vunzqy6gme2grnqxxn2ued9sv
3.3G	./pfgrd7oo49n9j432rmzifh040
2.6G	./hcn7lmxat20501gevoh6ikyq5
29G	./ijdmu2xmqg3wetpydxbjj5vpp
2.6G	./4bbvven1c6ax25s3qviz9ubab
29G	./pxmoznv5lmw6mno1yseax20yb
2.7G	./pzzrxeuonj4i2r8c9gzq36epg
2.6G	./p3t16ym0g18p89uvc13bmlcyy
29G	./usj2absvxglkn7wzpymn4md1k
2.7G	./8d4aj8jdls29gk6lefe06fxqx
2.7G	./ipgtbiztkpbrghowi4po7s9lh
2.2G	./vknzbsmnndo6dlyw985ztb50a
29G	./pemkvt0c6qef8d0b8jf0o0bwk
822G	.
root@mimi:/var/lib/docker/overlay2#

์–ด๋””์„œ ์šฉ๋Ÿ‰์„ ์ฐจ์ง€ํ•˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธ ์™„๋ฃŒ !

์ด์ œ ์ •๋ฆฌ๋ฅผ...

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€