# tmpfs setup?

## A.S. Pushkin

I've got a problem. I fell in love with my Samsung 850 PRO, but soon discovered that it has a serious problem, no matter

what I do it "fills up." I initially installed Gentoo on a 128GB 850 PRO with /home on a 320GB Seagate Baracuda. I

discovered the SSD was filling up and running DeVeDeNG to completion was failing. SO I migrated  to a

256GB 850 PRO. Well, the same thing has happened! This will be a problem with opencascade and libreoffice.

I decided to move /var and /tmp from the SSD to the spinner and that seems to have been successful, but I'm

having trouble setting up fstab to use tmpfs. I have 32GB of RAM so I assume that should work to help with this

problem. Perhaps I'm assuming too much, but I hope not. I have my old spinner so I'll have a look at that if I

am unable to find a solution on the Forum. I've done a lot of searching, but have not found a solution that solves

the problem.

I have run fstrim and it does temporarily return some disk space, but not enough. Oh, I should add that I

moved /usr/portage/distfiles to another SSD that basically only a storage device at this time. It

originally intended as my first attempt at RAID. I decided not to make the effort.

If I rebuild I'll have to try LVM or EVMS!

TIA

----------

## eccerr0r

I have a 180G and 240G SSDs for two of my computers.  I still have plenty of space on them.

You do need to make sure things are cleaned up:

eclean distfiles ### Remove distfiles that are not related to a ebuild

emerge -p --depclean ### uninstall excess packages.

and cleaning up your $PORTAGE_TMPDIR 

Often your /usr/src gets filled up with tons of kernels which are 1GB or so a piece.  After depcleaning those kernels, you may still need to remove the directories.  A lot of people end up with a lot of crap here along with distfiles that can no longer be used by portage.

----------

## NeddySeagoon

A.S. Pushkin,

fstrim is a SSD speed up, it does not free any space on your filesystems.

----------

## szatox

Ehm... Can you actually describe your problem?

Something is clearly not working, but I really can't see what are you stuck at.

cat /etc/fstab and df -h are likely to make a good start.

----------

## A.S. Pushkin

Thanks for the responses. I had thought fstrim was to clean out locations on the SSD that were vacated.

What appears to be happening is that the space is simply filling up. I actually moved distfiles to another drive,

updating make.conf to reflect that.

Also, thank you for shining light on the difference between eclean and emerge --dpclean!

```
#df -h

/dev/sda4       220G  205G  4.0G  99% /

tmpfs           3.2G  1.3M  3.2G   1% /run

dev              10M     0   10M   0% /dev

shm              16G     0   16G   0% /dev/shm

cgroup_root      10M     0   10M   0% /sys/fs/cgroup

/dev/sda2       120M   93M   19M  84% /boot

/dev/sdb1       269G  244G   15G  95% /home

/dev/sdb2       7.6G  118K  7.2G   1% /tmp

/dev/sdb3       7.7G  2.1G  5.2G  29% /var

/dev/sdc        118G   15G   97G  14% /mnt

none             16G   20K   16G   1% /run/user/1000

/dev/sdd2       437G  205G  210G  50% /run/media/pushkin/389cf391-5608-4b9f-be33-84939c3f37f2

/dev/sdd1       481G  200G  257G  44% /run/media/pushkin/9a84a5b7-8b2f-48ab-a5a8-6bf68365a6b7
```

/dev/sda - - Samsung 850 PRO - 256GB

/dev/sdb -- Seagate Baracuda - 320GB

/dev/sdd -- Seagate in my hotswap rack - 1TB

/dev/sdc -- Samsung 850 Pro - 128GB

/var and /tmp were recently relocated to the Baracuda in hopes  this might help.

Here's my current fstab:

```
UUID="c09f10fc-8dcc-48cb-b237-2135eb544514"     /boot            ext4           defaults,relatime        0 0

/dev/sda3               swap      swap      sw      0 0

UUID="e400e7d8-be6e-4284-9625-b281694a7271"   /      ext4      rw,relatime,data=ordered   0 1

UUID="30276bde-79de-4990-a5ff-8b9841c3a23a"   /home      ext4      rw,relatime,data=ordered    0 1

UUID="d1309034-a07d-422b-afe5-96e736bf91b0"     /tmp            ext4            rw,relatime,data=ordered        0 1

UUID="0d7a6b5c-f564-4c4f-8551-3f4e8442dead"     /var            ext4            rw,relatime,data=ordered        0 1

UUID="aeeb963e-d6b9-44c5-99c2-2cefeb6ee318"    /mnt         ext4      rw,relatime,data=ordered   0 1

shm                  /dev/shm   tmpfs      nodev,nosuid,noexec   0 0

tmpfs                              /shm            tmpfs         defaults,nosuid,size=1024M,mode=1777   0   0

/dev/sr0               /media/dvdrom   auto      noauto,user   0 0
```

After runningDeVeDeNG /dev/sda4 goes to 100% used. fstrim returns:

fstrim -v /

/: 10.1 GiB (10884395008 bytes) trimmed

Many thanks.

code tags added by NeddySeagoon

----------

## eccerr0r

Hmm.  DeVeDeNG is a DeVeDe NextGeneration video DVD creator, which I wasn't aware of...  As it's a video program, well, video programs tend to work with large files.

If that program is randomly creating a lot of junk files somewhere, well, will need to clean them up.

You could use 'du' to see if there are any big directories to see where it's dumping junk files that should be cleaned up.  If you have GNOME installed, you could use 'baobab' as a GUI to show what directories are eating tons of disk space, just let it analyze your disk and hover your mouse over the big sectors to see what directories are chewing up your disk.  The center of the circle graph is your root or whatever you selected as your startpoint, and the whole circle represents all of the data (empty space is not drawn).

----------

## Jaglover

```
du -xh --max-depth=1 /
```

Then dive into directories of interest.

----------

## NeddySeagoon

A.S. Pushkin,

```
#df -h

/dev/sda4       220G  205G  4.0G  99% /
```

That's the working parts of your system.  As you have /home and /tmp outside of that, nothing a user does should put anything like that amount of data there.

However, if you regularly run things as the root user, roots home directory is /root (not /home/root)

Its a bad thing to run as root for lots of reasons.

The portage user also uses space here for logs and building, which I've described in another thread.

A few portage things grow without limit ... until you prune them.

----------

## frostschutz

 *Jaglover wrote:*   

> 
> 
> ```
> du -xh --max-depth=1 /
> ```
> ...

 

in case there are files hidden under other mountpoints (copied stuff to /home while /home wasn't mounted etc.)

```

mkdir /mnt/root

mount --bind / /mnt/root

ncdu /mnt/root/

```

----------

## NeddySeagoon

frostschutz,

Well caught.  Does that work with  

```
/dev/sdc        118G   15G   97G  14% /mnt
```

?

----------

## Zucca

 *Jaglover wrote:*   

> 
> 
> ```
> du -xh --max-depth=1 /
> ```
> ...

 I'll add another choice here which I have found useful:

I use ncdu frequently to keep an eye on growing directories. It's also possible to delete directories and files via its UI.

I guess Midnight Commander could also fit for the purpose.

----------

## frostschutz

 *NeddySeagoon wrote:*   

> Well caught. Does that work with  
> 
> ```
> /dev/sdc        118G   15G   97G  14% /mnt
> ```
> ...

 

Well, yes. It works. Nevertheless, feel free to replace /mnt/root with anything that's convenient.

Maybe I'm too old but I dislike /mnt being used directly... it's always /mnt/somename for me.  :Wink: 

----------

## A.S. Pushkin

Elsewhere on the  forum  *Quote:*   

> Excessive trim [SOLVED]

 

I post what I learned about lost disk space.. I learned that /media and /run/media

are not the same. I'm still working on issues related to my current post, but once I deleted

files I had copied to /media and and my base drive all lost disk space was returned

and DeVeDeng was up and running. It is my goto DVD application, but seems not to allow the user

to select location for temporary files. 

By the way, Zucca and frostschutz, thanks for the tip on ncdu!

I'll have to take the lead from your posts and correct my mount at /mnt. I used it as I was

unsure just how to permanently mount the SSD where I'm storing my distfiles.

Thank you!

----------

