Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: leekimpark on June 27, 2012, 10:55:10 PM
-
So I'm fairly new to linux and tce, but I've been trying to install TCE and have it use the minimum amount of disk space. I've been testing it out on Virtualbox and I can't seem to bring down the disk usage to around 10mb. Right after installing using the Core-plus.iso to install with frugal install and options like text only, this is what my disk space usage looks like, using df -h
Filesystem Size Used Available Use% Mounted on
rootfs 222.8M 9.4M 213.4M 4% /
tmpfs 123.8M 0 123.8M 0% /dev/shm
/dev/sda1 7.9G 25.6M 7.8G 0% /mnt/sda1
/dev/sda1 7.9G 25.6M 7.8G 0% /home
/dev/sda1 7.9G 25.6M 7.8G 0% /opt
From what I've been reading via the website and google, TCE should be able to achieve much lower disk usage. I've also seen this thing about microcore, and I've tried to install it, but I can't seem to find the microcore.gz file during installation. All it gives me is core.gz. But regardless, what are other ways I can reduce disk space to about 10mb, or is this not possible? Sorry if this is a really newbie question.
-
Hi leekimpark
The core.gz and vmlinuz files in your /mnt/sda1/boot/ directory account for about 12MB of that. To find out what
is taking the remaining space, check under the /mnt/sda1/tce/ directory.
Microcore is just called Core now and consists of core.gz and vmlinuz.
-
Hi Rich,
There doesn't appear to be much in /mnt/sda1/tce, aside from the boot directory. Here's what ls -alh gives me:
total 20
drwxrwxr-x 5 tc staff 4.0K Jun 28 05:20 ./
drwxrwxr-x 6 root root 4.0K Jun 28 05:20 ../
drwxrwxr-x 3 tc staff 4.0K Jun 28 05:20 boot/
-rw-rw-r-- 1 tc staff 0 Jun 28 05:20 mydata.tgz
-rw-rw-r-- 1 tc staff 0 Jun 28 05:20 onboot.lst
drwxrwxr-x 2 tc staff 4.0K Jun 28 05:20 ondemand/
drwxrwxr-x 2 tc staff 4.0K Jun 28 05:20 optional/
when I cd into and ls in the optional and ondemand directories there doesn't appear to be anything. Where else could the remaining space be used?
-
Hi leekimpark
Try du /mnt/sda1 | less
Use PageUp/PageDown to navigate, q to quit.
-
Hi Rich,
du /mnt/sda1 gives me:
4.0K /mnt/sda1/home/tc/.local/bin
8.0K /mnt/sda1/home/tc/.local
24.0K /mnt/sda1/home/tc
28.0K /mnt/sda1/home
40.0K /mnt/sda1/tce/boot/extlinux
7.6M /mnt/sda1/tce/boot
4.0K /mnt/sda1/tce/optional
4.0K /mnt/sda1/tce/ondemand
7.6M /mnt/sda1/tce
28.0K /mnt/sda1/opt
16.0K /mnt/sda1/lost+found
7.7M /mnt/sda1
Still doesn't look like much, perhaps I messed up during the installation?
-
'df' shows filesystem space used.
'du -s' shows summarized disk usage of files.
-
Hi leekimpark
Looks like you have Core installed, 7.7MB.
-
Hi Rich,
If that's the case, then do you have any idea what's using up all this disk space, or am I just misinterpreting the results of running df -h?
-
As implied in Reply #5, df includes space taken up by a filesystem, as opposed to du which shows only space taken up by the files residing on the filesystem per se.
-
In reference to the thread subject:
Persistent /home & /opt mode is bound to result in the exact opposite.
-
Hi leekimpark
I don't know why you have such a big discrepancy between the two commands. I just ran du and df on my
system and came up with 1.7GB and 1.9GB respectively for my drive. Maybe you did a re-install in between,
or deleted something, or maybe it's due to Virtualbox.
-
Sorry about that, I'm new to all of this. I'm sure that i didn't reinstall or delete anything since I checked my disk space usage right after creating a new virtual machine and installing TCE. I'll try installing on a real machine later to see if this is because of Virtualbox. However, is TCE actually supposed to use just around 10mb right after installation?
-
Hi leekimpark
Core will be about 8MB and Tinycore will be about 12MB installed. These are bare bones installations, and
you will need to install any applications you are interested in.
-
Hi leekimpark
I don't know why you have such a big discrepancy between the two commands. I just ran du and df on my
system and came up with 1.7GB and 1.9GB respectively for my drive. Maybe you did a re-install in between,
or deleted something, or maybe it's due to Virtualbox.
I wouldn't consider 17.9M on a partition of 7.9G a big discrepancy at all, not outside the expectable.
-
The default VirtualBox drive capacity is (approximately) 8 GB Unless you specify another size.
Additionally, this is a frugal install which accounts for all the extra space used IMO
Discard the frugal install you'll be left with only the boot loader, the core.gz, vmlinuz, file system overhead. of course there will not be any apps but you can always add tce to the bootloader config and install apps to that directory but permanent apps add lots of bulk to the system.
I have several VM's running less than 15MB with a few specialized applications and scripts, I think the smallest I've deployed is a 12MB ISO (I'd have to recheck but iirc it's less than 12MB using core with apps).
-
In reference to the thread subject:
Persistent /home & /opt mode is bound to result in the exact opposite.
Sorry, i'm not sure I understand that last bit.
-
To achieve a goal of minimizing space usage persistent /home and /opt mode has to be avoided (in favour of backup/restore mode).
-
Hi leekimpark
I'm not sure what the problem is here, du is the tool to use if you want to see how much space is being used
on a drive or in a directory. Your installed size is the sum of the vmlinuz and core.gz files. Anything in the
home and tce directories will be added by you and don't count since they will vary from one individual to
the next. If you don't believe the du command, try this:
ls -RShl | less
and add up the sizes of the larger files, there shouldn't be to many files.
What you have is not a frugal install. A frugal install means that your /home and /opt directory are located in
RAM. When you shutdown, you run a backup which compresses the two directories into a file called mydata.tgz
which is saved in your tce directory. When you start up, the file is automatically decompressed and the directories
are restored. This saves disk space, slows booting and shutdown, and gives faster file access. If you lose power,
you lose all changes since the last time you ran a backup. You are running persistent home and opt directories.
This occupies more disk space, gives faster boots and shutdowns, and slower files access. If you lose power, you
only lose what you have not saved in any currently open files.
-
Hi Rich,
I think there's been a misunderstanding, I have no issues with du, or df, I just ran the former since you asked and was just wondering why a disk space usage listing shows that so much space is being use up. Sorry about that.
Anyways, I was not aware that was how things worked, my understanding of TCL is still very weak. Still, even if persistent home and opt result in more disk space, is it really supposed to be that high, around 75 mb more than a nonpersistent home and opt installation? I mean, there's nothing really inside either directory except for the boot folder...
If that's the case then, is there a more disk space efficient way to achieve persistence of some extensions?
-
Unclear where you derive "around 75 mb more" from.
Evidence provided by you shows that TC takes up 7.7M total.
-
Your df output shows 17mb of file system overhead + 7.7mb of TC files. Both are completely reasonable.
-
not arguing here.
just curious, what exactly does filesystem overhead constitute?
would that be, for example, the 4k an empty directory takes (summed of course over the many empty directories in the fs)?
perhaps that would clear up the OP's confusion.
also @leekimpark, are you getting the 75mb figure by summing
/dev/sda1 7.9G 25.6M 7.8G 0% /mnt/sda1
/dev/sda1 7.9G 25.6M 7.8G 0% /home
/dev/sda1 7.9G 25.6M 7.8G 0% /opt
these three records in the df -h output?
i believe those refer the filesystem usage on /dev/sda1 which /mnt/sda1, /home, /opt all symlink to. IOW, 25.6Mb filesystem usage is referring to the same thing. Someone please correct me if I'm wrong.
cheerio,
solorin
-
Like solorin said, I derive the 75mb by summing the three 25.6mb directories. But I remember I booted into the gparted live cd to check disk usage and it was pretty high. Now that I try this again, it gparted gives me a disk usage of about 156 mb, which is really strange. I went into terminal again and mounted /dev/sda1 again and ran du -h on it and it gives me 7.7mb, df -h gives me 26mb which takes into account as people have mentioned filesystem overhead. So I think this whole thing has been my mistake and that tcl's disk usage is as advertised. Sorry for such a stupid error, and thanks for all the help!
-
just curious, what exactly does filesystem overhead constitute?
Not 100% sure, but I believe it's the journal and other housekeeping tables.