0

I have a mirrored rpool:

NAME                       USED  AVAIL  REFER  MOUNTPOINT
rpool                     72.1G  1.22G  39.5K  /rpool
rpool/ROOT                67.9G  1.22G    31K  legacy
rpool/ROOT/solaris        67.9G  1.22G  19.8G  /
rpool/ROOT/solaris/var    48.0G  1.22G  47.8G  /var
rpool/dump                1.25M  1.22G  1.02M  -
rpool/export              53.9M  1.22G    32K  /export
rpool/export/home         53.8M  1.22G    33K  /export/home
rpool/export/home/m       53.8M  1.22G  53.7M  /export/home/m
rpool/swap                4.13G  1.35G  4.00G  -

My /var used a lot of space, probably some logs from samba

I've read Solaris 11 and zfs, i don't understand space used , but I haven't any snapshot for /var (I've already deleted auto-snapshots):

root@myhost:~# zfs list -t all
NAME                                                             USED  AVAIL  REFER  MOUNTPOINT
rpool                                                           72.1G  1.22G  39.5K  /rpool
rpool@zfs-auto-snap_hourly-2015-11-27-19h04                       19K      -  39.5K  -
rpool@zfs-auto-snap_hourly-2015-11-28-10h08                       19K      -  39.5K  -
rpool@zfs-auto-snap_hourly-2015-11-28-11h08                         0      -  39.5K  -
rpool/ROOT                                                      67.9G  1.22G    31K  legacy
rpool/ROOT/solaris                                              67.9G  1.22G  19.8G  /
rpool/ROOT/solaris@install                                       106M      -  2.99G  -
rpool/ROOT/solaris/var                                          48.0G  1.22G  47.8G  /var
rpool/ROOT/solaris/var@install                                   188M      -   304M  -
rpool/dump                                                      1.25M  1.22G  1.02M  -
rpool/export                                                    53.9M  1.22G    32K  /export
rpool/export/home                                               53.8M  1.22G    33K  /export/home
rpool/export/home/m                                             53.8M  1.22G  53.7M  /export/home/m
rpool/export/home/m     @zfs-auto-snap_hourly-2015-11-28-10h08    94K      -  53.7M  -
rpool/export/home/m     @zfs-auto-snap_hourly-2015-11-28-11h08    34K      -  53.7M  -
rpool/swap                                                      4.13G  1.35G  4.00G  -

it seems to me, the space is used by current files in /var, but when I check

root@myhost:/var# du -sh
  14G   .

I cannot find the half of my space...

UPDATE:

Okay, I've restarted samba service

# svcadm restart cswsamba

And now

root@myhost:/var# zfs list -t all
NAME                                                             USED  AVAIL  REFER  MOUNTPOINT
rpool                                                           39.3G  34.0G  39.5K  /rpool
rpool@zfs-auto-snap_hourly-2015-11-27-19h04                       19K      -  39.5K  -
rpool@zfs-auto-snap_hourly-2015-11-28-10h08                       19K      -  39.5K  -
rpool@zfs-auto-snap_hourly-2015-11-28-12h08                         0      -  39.5K  -
rpool/ROOT                                                      35.1G  34.0G    31K  legacy
rpool/ROOT/solaris                                              35.1G  34.0G  19.8G  /
rpool/ROOT/solaris@install                                       106M      -  2.99G  -
rpool/ROOT/solaris/var                                          15.1G  34.0G  15.0G  /var
rpool/ROOT/solaris/var@install                                   188M      -   304M  -
rpool/ROOT/solaris/var@zfs-auto-snap_hourly-2015-11-28-12h08    2.47M      -  14.8G  -
rpool/dump                                                      1.25M  34.0G  1.02M  -
rpool/export                                                    54.0M  34.0G    32K  /export
rpool/export/home                                               53.9M  34.0G    33K  /export/home
rpool/export/home/m                                             53.9M  34.0G  53.7M  /export/home/m
rpool/export/home/m     @zfs-auto-snap_hourly-2015-11-28-10h08    94K      -  53.7M  -
rpool/export/home/m     @zfs-auto-snap_hourly-2015-11-28-11h08    80K      -  53.7M  -
rpool/export/home/m     @zfs-auto-snap_hourly-2015-11-28-12h08    66K      -  53.7M  -
rpool/swap                                                      4.13G  34.2G  4.00G  -

What happened and how can I keep clear of this error?

  • I don't see any mention of multiple boot environments in the question (referring back to the same link). – Thomas Dickey Nov 28 '15 at 11:36
  • I have just the original installed one, but it seems I could solve this issue... – llaszlo Nov 28 '15 at 11:44
  • 1
    More generally, your system could have files in /var which are still open, but deleted. You could see that using lsof or fuser. – Thomas Dickey Nov 28 '15 at 11:47
  • Thanks @ThomasDickey! So is there some bug in Samba, and when I delete log files, the smbd process still hold the file, and Solaris cannot free the space in filesystem? Or that was my fault and I should remove logs in a different way? – llaszlo Nov 28 '15 at 12:02
  • 2
    There is no bug in Solaris, this is the expected and correct behavior. Removing log files while they are actively written by a process is the culprit. You should have truncated them instead to save disk space. – jlliagre Nov 28 '15 at 12:46
0

There are many applications which keep log files open, even when they are deleted. The resolution to that differs per application by sending a signal or restarting/reloading the application. One way to claim diskspace back while a process is still using it is to overwrite it with no data like:

> /path/to/old_log

After this you can delete the file but the application will still have an open file descriptor to the file until you restart/reload the application or do whatever is necessary for that particular application to let it close its old log files.

Refer also to the -c switch of logadm

0

You can also turn the compression on /var so that log files get compressed which will give some breathing room. ie: zfs set compression=on rpool/ROOT/solaris/var

In your output, I also saw a snapshot for install. You may have old BE's also taking up space. beadm list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.