View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 12 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Jul 08, 2012 5:47 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
I am not really comfortable with this partition being full and not really sure where to begin to diagnose the problem.

[username@mythtv htdocs]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.9G 4.9G 0 100% /

Should I be asking what are the largest files or is there a better diagnostic question to be asked?

Command line examples are appreciated. Thank you.

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Top
 Profile  
 
PostPosted: Sun Jul 08, 2012 7:24 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1995
Location: /dev/null
Code:
# ncdu -x /

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
PostPosted: Mon Jul 09, 2012 8:55 am 
Offline
Joined: Wed Mar 21, 2012 7:59 am
Posts: 63
This happens to me a lot because of running xbmc with auto-updating skins and addons. I copied this fromthe old knoppmyth wiki because it is really helpful to me for identifying and deleting large files filling up the partition. double astriks ** means code...

By far the most common problem people encounter with restarting a previously running ~KnoppMyth system are "out of disk space" issues. MythTV and thus KnoppMyth have two disk partitions (herein refered to as program and data) that can run out of space and you get two different sets of problems for the two different partitions.


!!! Out of Space on Data Partition

If you happen to leave live TV playing all day, which fills up the data partition and makes further recording impossible, then the solution, starting from the Main MythTV menu is to go to Media Library -> Watch Recordings -> All Programs, scrolled down to the first program that you want to delete and press the right arrow once. Pick delete from the menu and confirm it. Continue deleting recordings this way till you have deleted all the undesirable ones that it recorded that day. Be aware that all of your disk space will not show up at once, but will appear at the rate of maybe 1 Gig per minute. FYI, Media Library -> Watch Recordings is better than the Manage Recordings -> Delete Recordings because it shows the most recent recordings at the top. If you don't have an All Programs in Watch Recordings then go to Manage Recordings -> Delete Recordings -> All Programs and page down till you get to the end to delete today's recordings.

Something that I have found happens occasionally when you get a power failure while recording something is what I call "orphaned recordings". You have a recording file in /myth/tv that MythTV does not know is there. I have written a script called [orphan|http://www.knoppmythwiki.org/index.php?binary=internal%3A%2F%2F8b530b331b353eafd8777974270ebfd5.bin] that will find these and move then to a directory called /myth/video/orphan so you can play them as if they were videos and keep or delete them as you desire. **Warning: Do not run orphan while a recording is in progress or it will consider the show being recorded as an orphan.** To use it do the following:
- Log in to a text console as user mythtv (On your KM box: Ctrl-Alt-F1 will usually get you a text console login prompt. Alt-X will get you an already logged in XTerm that you can use too).
- Download orphan by executing **wget -O orphan http://www.knoppmythwiki.org/index.php? ... bfd5.bin**
- execute **chmod a+x orphan**
- execute **./orphan**

There are other things you can check for wasted file space. One is whether a disk problem has ever caused any files to be moved to /myth/lost+found. This generally does not happen with ext3 file systems though. To check your /myth/lost+found do this:
- BecomeRoot
- execute **ls -l /myth/lost+found**
It prints out a line like this on my good working system
<pre>
total 0
</pre>
meaning that there are no files there. If, on the other hand there are files there you can execute the following if you are sure you do not need any of those files. It will prompt you for each file:
- execute **rm -vir /myth/lost+found/* **

BTW - Leaving it on live TV is not really recommended. Leaving the system on live TV, or the recordings page with the thumbnail preview, or in a continuous playback loop, runs your disk drives more and thus wears them out sooner.


!!! Out of Space on Program Partition

<pre>
To my experience, there are two classes of causes for this:
</pre>
# It goes away with a reboot
# It does not go away with a reboot

Be aware that rebooting sometimes frees up a small amount of space so your first reaction may be "I already know that it goes away for a little while if I reboot". The following test will tell for sure whether the reboot really helps or only helps a little.

The next time you have the problem do this to see if rebooting really helps or not:
- BecomeRoot
- execute **du -xhs /**
It prints out a line like this on my good working system
<pre>
2.4G /
</pre>
If this number is above 4.0G then you have "normal" log files / lost+found files to clean up and you should skip down to "Deleting log files" below.
- else execute **df -h /**
It prints like this on my good working system
<pre>
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.7G 2.6G 2.0G 56% /
</pre>

Note that my "Used" column says 2.6G which is pretty close to the 2.4G I just saw and shows plenty of room left on the 4.7G partition. If it says something above 4.0G and the 'du -xhs /' said something less than 3.5G then you have "hidden/deleted" files or something else. You should
- execute **lsof | grep delete**
to find out what files are pending deletion.

Files that are pending deletion go away when you reboot the system. Note that it is normal to have some files in this list. This is what mine looks like:
<pre>
root@mythtv2:~# lsof | grep delete
mysqld 3284 mysql 4u REG 8,1 0 171394 /tmp/ibSox729 (deleted)
mysqld 3284 mysql 5u REG 8,1 0 171396 /tmp/ibABRNV9 (deleted)
mysqld 3284 mysql 6u REG 8,1 0 171398 /tmp/ibUHmiO9 (deleted)
mysqld 3284 mysql 7u REG 8,1 0 171399 /tmp/ibo7U6vc (deleted)
mysqld 3284 mysql 11u REG 8,1 0 171400 /tmp/ib6N6uXj (deleted)
smbd 3395 root 2w REG 8,1 231665 150262 /var/log/samba/log.smbd.1 (deleted)
smbd 3395 root 5w REG 8,1 231665 150262 /var/log/samba/log.smbd.1 (deleted)
</pre>
The second to last numeric column is the file size so we can see that I have a total of 463k that will be reclaimed if I reboot. This is trivial (0.01%) on a 4.7G partition.

If you find that your system has say 1G or more worth of deleted files then you have determined that rebooting will make the problem go away. This really should not be happening and you may have underlying problems on your system. I would suggest that you make a post with all the commands you have executed and the output of each. If it is a bug it needs to be fixed. If it is a configuration issue in your system then that should be fixed and the developers should be made aware that such configuration issues are happening in the wild (there may not be much they can do in the short term though).

If it is not hiding in the deleted files then skip down to "Other Tests".

! Deleting Log Files

There was past version of KM that had a problem with SQL log files growing forever without proper purging. The following gives you a list of log files over 10M in size. If it is a log file and it is over 10 meg in size you should probably delete it.

- execute **find /var/log -size +10M -iname '*.log*' -ls**

The following deletes log files over 10M in size.

- execute **find /var/log -size +10M -iname '*.log*' -ls -delete**

If this doesn't fix it then post in the help form, listing ALL the commands you have executed and the results of those commands.

! Other Large Files

The following gives you a list of the 50 biggest files and directories on your root partition. If you know what you are looking at you can delete some of the files in this list, else post for some help. If it is a log file and it is over 10 meg in size you should probably delete it. Files in lost+found should usually be deleted but be aware that any file on the system could wind up there after a disk problem. Don't say I didn't warn you...

- execute **du -xkaS / | sort -n | tail -50**

! Other Tests

<pre>
If it does not go away with a reboot and you did not find it
with the above instructions then it may be:
-- A corrupt file system. First you should fsck your
drives. A good way to do that is to shutdown with
'reboot' and 'force fsck on startup' by executing
**shutdown -Fr now**
A huge journal file created by a disk corrupting system
crash could do this, but I am not aware that this has
actually ever happened. You can check for this with
this (of course replace sda1 with whatever your root
partition is mounted on)
**debugfs -R "stat <8>" /dev/sda1**
-- Recordings stored in the UNMOUNTED /myth directory.
This happened to me. For some reason, one time my
/myth did not mount and so it put the recordings on
sda1 instead of sda3. You can check for this by booting
a Knoppix (yep, Knoppix, not KnoppMyth) disk and seeing
if there is anything in /myth or for that matter in any of
the other mount points. You could also boot your KM
system in single user mode then:
**umount /myth**
and
**ls /myth**
to see if there is anything hiding there. Check your
other mount points if you have created any.
</pre>
I refer you to this thread where I had the issue where it did
not go away on reboot if you are interested:
[http://knoppmyth.net/phpBB2/viewtopic.php?t=17915&highlight= ]


! (original contents of page follows)

By far the most common problem people encounter with restarting a previously running ~KnoppMyth system are "out of disk space" issues. The most common cause for this are system log files which have gotten very large for some reason, usually due to a persistent system problem.

If you happen to leave live TV playing all day, which fills up the disk and causes nothing to work?I feel your pain. Our KnoppMyth system was in an endless loop of telling us ?xsession: warning: unable to write to /tmp; X session may exit with an error.? Restarting X would bring up the exact same message over and over. What fun. At this point you?ll figure out that you need to get to single-user mode to be able to do anything. (BTW - This is not a recommended use pattern. Leaving the system on live TV, or the recordings page with the thumbnail preview, or in a continuous playback loop, increases the wear and tear on your disk drives substantially and can reduce their service life.)

But how do you do that? It took me about a half-hour to figure out, but hit capslock to bring up LILO. At the boot prompt you can enter ?Linux single? to get started in single-user mode. You can also use any of the techniques described in the BootToSingleUserMode or InstallDiskAsRescueCD pages to get the system up to the point where you can do repairs.

Once you have the system running in single user mode, or in multi-user mode and you have BecomeRoot, you can go through and delete the giant files. Interesting, it was a 3+ GB mythfrontend.log file causing the trouble. There are several simple methods to find the offending files. Running the following command as root will show you the disk usage hot spots:
<code>du -xk / | sort -n</code>
You can then list the contents of those directories and look for the largest files there. For example:
<code>ls -alSr /var/log/mythtv</code>
Finally you can delete or truncate the problem files and reboot the system.

After rebooting you may also find that the database needs to be repaired. See the PerformanceOptimizeHowTo or RepairingMythConvergDB pages for details on doing this.

Remember! To do maintenance on a Linux/Unix system you generally need to BecomeRoot first.


Top
 Profile  
 
PostPosted: Mon Jul 09, 2012 9:45 am 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 677
Another alternative would be to expand the size of your boot partition. Back in the day I used GParted to successfully expand my boot partition because diskless images were eating up all my space. If you double or triple the size of the partition that could help.


Top
 Profile  
 
PostPosted: Mon Jul 09, 2012 9:49 am 
Offline
Joined: Wed Mar 21, 2012 7:59 am
Posts: 63
I have tried Gparted a few times, but it always fails for me. Dont know why.


Top
 Profile  
 
PostPosted: Mon Jul 09, 2012 11:45 am 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 677
It been a long time since I tried it but if I remember correctly the basic idea is you have to shrink your third partition (sda3) and then you have room to expand (sda1). it takes a while to shrink sda3 because it has to move all the files over. Then you can expand SDA1 by the amount that you made free space.


Top
 Profile  
 
PostPosted: Tue Jul 10, 2012 12:20 pm 
Offline
Joined: Tue Aug 15, 2006 11:14 am
Posts: 1196
Location: Orlando FL
The orphaned recordings thing doesn't work because Knoppmythwiki.org doesn't exist anymore.

_________________
My System


Top
 Profile  
 
PostPosted: Sun Jul 15, 2012 9:07 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
I blew away acpid.log the other day to reclaim 600+MB and now it has returned. I should have reviewed the file before I blew it away. Any experience or insight would be appreciated.

[root@mythtv ~]# find /var/log -size +10M -iname '*.log*' -ls
93269 626428 -rw-r----- 1 root log 640831488 Jul 15 15:24 /var/log/acpid.log
[root@mythtv ~]# rm /var/log/acpid.log

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Top
 Profile  
 
PostPosted: Sun Jul 15, 2012 11:06 pm 
Offline
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1530
Location: California
gatorback wrote:
I blew away acpid.log the other day to reclaim 600+MB and now it has returned. I should have reviewed the file before I blew it away. Any experience or insight would be appreciated.


Here is a thread on how to solve this problem -- viewtopic.php?f=21&t=21253

_________________
Marc

The views expressed are my own and do not necessarily reflect the views of my employer.


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 5:18 pm 
Offline
Site Admin
Joined: Fri Sep 19, 2003 6:37 pm
Posts: 2657
Location: Whittier, Ca
Recently, I ran into an issue with / getting filled. Turns outs, after years and years of using MythTV, ~/.mythtv had grown to about a gig on my MBE and over 800 megs on my SBE. I moved them to /myth/ and made ~/.mythtv a symlink.


Top
 Profile  
 
PostPosted: Fri Oct 13, 2017 6:17 am 
Offline
Joined: Sat Oct 07, 2017 3:01 am
Posts: 1
tama103 wrote:
I have tried Gparted a few times, but it always fails for me. Dont know why.


I can never get it to work either. :(


Top
 Profile  
 
PostPosted: Fri Oct 13, 2017 8:01 pm 
Offline
Joined: Mon Apr 10, 2006 3:48 pm
Posts: 890
Location: Lexington, Ky
Gparted won't work because there is no free space available between partitions.

You have to move the other partitions to create space between /dev/sda1 and the adjacent partition, before you will be able to expand the the partition.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu