Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to reduce the size of the installation?

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: How to reduce the size of the installation?

#31 Post by Deb-fan »

Cool stuff, meant to mention choice of filesystem perhaps, btrfs = onthefly de/compression don't know what kind of processor you're working with on the box. Compression has to mean being able to cram more data in x-amount of space. Verses ext4 or whatever with its tendency to reserve part of available disk space. Also tend towards doubting it'll get you there. This pi-hole thing ate 500mbs like that, yowza? Still rooting for you. :)
Most powerful FREE tech-support tool on the planet * HERE. *

TygerTung
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

#32 Post by TygerTung »

It has a duel core 1 GHz VIA Eden so pretty powerful, considering what it has to do, i.e. not much. boots real quick into the terminal.

I'll try the file system you mentioned. I think if I am really careful about installing block lists I might be alright. If I get real desperate I can not install the web interface, but it would be a real pain not to have it.

brian_p
Posts: 196
Joined: 2015-11-05 10:32
Has thanked: 1 time
Been thanked: 5 times

Re: How to reduce the size of the installation?

#33 Post by brian_p »

OK great, I got it down to 51% of the disk. Still seems big for a terminal only system but never mind.
This is just about the minimum that Debian reckons is required for a functioning Debian system. From now on you would just be tinkering round the edges. For example, install and use deborphan and do

Code: Select all

apt --purge autoremove.
I don't need to add any users for example, so maybe I could remove adduser?
Try it! ifupdown depends on adduser; you wouldn't want that removed too. (Warning: take note of the scary message).

pi-hole appears to want about 60M minimum. You are going to have to make decisions on what you install and how to manage it now and in the future. That means more reinstallations and becoming more familiar with how pi-hole works. As I said, it looks doable to me but I have no idea how pi-hole functions. These lists? What are they? Are they essential?
--
Brian.

brian_p
Posts: 196
Joined: 2015-11-05 10:32
Has thanked: 1 time
Been thanked: 5 times

Re: How to reduce the size of the installation?

#34 Post by brian_p »

I think I need to re-install again and work out a way to have the base system on the internal drive and then the programmes like pi-hole installed on this (slow) usb flash drive I have.
An expert install would allow you to partition and put /usr on the flash drive. I do wonder whether speed is of the essence with pi-hole?
--
Brian.

brian_p
Posts: 196
Joined: 2015-11-05 10:32
Has thanked: 1 time
Been thanked: 5 times

Re: How to reduce the size of the installation?

#35 Post by brian_p »

I said:
From now on you would just be tinkering round the edges.
Well, perhaps not - I forgot about the kernel modules in /lib.

Code: Select all

du -h
tells me they use about 150M. Will I ever use all those wireless and sound drivers?
--
Brian.

TygerTung
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

#36 Post by TygerTung »

I've reinstalled using btrfs and thinned it out again.

However I am having a problem with drive space. Even though the drive should be about 976 MB it is only assigning me much 684 MB so even though I have only got 486 MB used, it is saying my drive is 72% full. I think that maybe it is assigning a whole lot of space to swap or temporary drives?! I don't know how to control it. At least with the Ext4 I was able to assign no swap and no reserved blocks.

Also I don't know how to turn the compression on. I'm not sure if it is on by default.

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
udev            944M     0  944M   0% /dev
tmpfs           190M  2.9M  187M   2% /run
/dev/sda1       976M  486M  198M  72% /
tmpfs           947M     0  947M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           947M     0  947M   0% /sys/fs/cgroup
With regard to the kernel modules, it is hard to know which ones I can remove. I don't need any wireless or sound drivers, or many other drivers at all really. I don't think I can delete the whole folder or anything though.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: How to reduce the size of the installation?

#37 Post by Deb-fan »

Would have to read the docs and google as needed for btrfs and on removing unused kernel modules. Been a long while since ive had a real interest in obsessively trimming down a nix OS and sub-1gb is pretty dang extreme. Getting to the point you have you're doing pretty dang good.

Btw: Amount of space reserved on ext4 can be tuned, stuff like https://duckduckgo.com/?q=reduce+reserv ... =h_&ia=web . Five percent is still 5% = 50mbs, if every mb counts, clearly +1 Brian's observation/suggestion too. If you havent already, remember i used to get rid of unused locales and at that time doing so freed up a decent enough chunk.
Most powerful FREE tech-support tool on the planet * HERE. *

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: How to reduce the size of the installation?

#38 Post by Deb-fan »

Btw2: With absolute min installed locales o course dont matter here, still popped into head, out keyboard. :P Honestly btrfs is just muddying the water too, though its de/compression features could be made to be a benefit, its still overkill and if anything again might consider tuning ext4, a simpler filesystem vs more complex type. Pretty much hit end-of-line as to what to suggest. Well one more.. choice of init, am sure many with the goal of embedded gnu/nix may go with something like SysV or runit or other, other than systemd and remember reading it can be trimmed itself. Was a good choice jettisoning grub for something simpler. Cool. :)

All these things add complexity + in terms of learning curve. If someone wants to learn about setting up alternative init's, deal with init scripts, run levels etc. Never bothered studying embedded nix to any great extent and at this time still have no great interest. Being limited to 1gb of disk space is well into embedded gnu/nix territory in my view, crap the dirt cheap Android phone im typing on has 8gbs. :) Still imo, you're doing well and its an interesting project. You've bound to have learned some good Nixology while doing all this. :)
Most powerful FREE tech-support tool on the planet * HERE. *

TygerTung
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

#39 Post by TygerTung »

Well after doing a lot more research I have managed to enable the compression on the BTRFS scheme. It made a massive difference!

Code: Select all

root@debian:/# btrfs filesystem df /
Data, single: total=626.50MiB, used=212.85MiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=160.75MiB, used=16.34MiB
GlobalReserve, single: total=16.00MiB, used=0.00B
root@debian:/# btrfs filesystem usage /
Overall:
    Device size:		 976.00MiB
    Device allocated:		 964.00MiB
    Device unallocated:		  12.00MiB
    Device missing:		     0.00B
    Used:			 245.57MiB
    Free (estimated):		 413.65MiB	(min: 413.65MiB)
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		  16.00MiB	(used: 0.00B)
Got down to maybe 245 MB used, although the file system seems to allocate 160 MB to metadata for some reason which seems too much. It is a bit of a complicated file system. I think it allocates data between the data and metadata though so might not be too bad. Even if a bit of space is lost, the compression is so good that it more than makes up for it.

Post Pi-hole install and adding to the blocklist database (now have 269093 domains blocked, that should be quite a few bytes just there), there is still oodles of space on the drive!:

Code: Select all

root@debian:/home/sam# btrfs filesystem df /
Data, single: total=448.00MiB, used=396.45MiB
System, DUP: total=5.50MiB, used=16.00KiB
Metadata, DUP: total=48.75MiB, used=21.06MiB
GlobalReserve, single: total=16.00MiB, used=0.00B
root@debian:/home/sam# btrfs filesystem usage /
Overall:
    Device size:		 976.00MiB
    Device allocated:		 556.50MiB
    Device unallocated:		 419.50MiB
    Device missing:		     0.00B
    Used:			 438.61MiB
    Free (estimated):		 471.05MiB	(min: 261.30MiB)
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		  16.00MiB	(used: 0.00B)

Data,single: Size:448.00MiB, Used:396.45MiB
   /dev/sda1	 448.00MiB

Metadata,DUP: Size:48.75MiB, Used:21.06MiB
   /dev/sda1	  97.50MiB

System,DUP: Size:5.50MiB, Used:16.00KiB
   /dev/sda1	  11.00MiB

Unallocated:
   /dev/sda1	 419.50MiB
brtfs is a pretty weird file system and it is quite hard to actually know how much free space is avaliable, there is quite a large quantity of commands to query it and I think you have to just guess.

The machine still runs lightning fast and boots really quickly as it is so powerful.

Memory usage: 2.4 % so plenty of headroom on the RAM front and there seems to still be plenty of room on the hard drive too.
With btrfs it seems that I can add a second drive and set it behave as one volume, so I can do that if I run out of space on the 1 GB drive. I think it is not going to be a very good to use a cheap no brand USB flash drive as a hard drive so I wish to avoid doing this if possible.

Anyway, happy days.
https://www.youtube.com/watch?v=gqsT4xnKZPg

TygerTung
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

#40 Post by TygerTung »

For something real easy to see, here is the "df -h" command (not accurate on btrfs)

Code: Select all

root@debian:/home/sam# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            944M     0  944M   0% /dev
tmpfs           190M  2.9M  187M   2% /run
/dev/sda1       976M  455M  471M  50% /
tmpfs           947M  252K  947M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           947M     0  947M   0% /sys/fs/cgroup
only 50% usage!

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: How to reduce the size of the installation?

#41 Post by Deb-fan »

Now that is awesome, you get A+ for effort and looks like success. Woot! :)
Most powerful FREE tech-support tool on the planet * HERE. *

TygerTung
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

#42 Post by TygerTung »

Now the only thing left to do is to work out how to change the font colour in the terminal from grey to green. I already worked out how to change the resolution to 1280x1024, but the font colour seems to be not so easy.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: How to reduce the size of the installation?

#43 Post by Deb-fan »

Should know this but off top don't. Assuming you're talking about the default user shell = bash. So things like...

https://duckduckgo.com/?q=set+font+colo ... =h_&ia=web

Ps, almost surely better places/files this type of thing can be set too. System-wide or user. Bashrc was first to pop into mind. Setting and customizing shell font + appearance is definitely well covered. You kicked butt in grasping btrfs, so something like this is bound to be piece of cake. :)
Most powerful FREE tech-support tool on the planet * HERE. *

Post Reply