LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-27-2010, 03:51 AM   #1
mayrus9
LQ Newbie
 
Registered: Jun 2009
Location: India
Distribution: Redhat, Suse, Fedora,
Posts: 13
Blog Entries: 1

Rep: Reputation: 0
Question lsof output description


Hi,

i have two questions,

1)the size mentioned in lsof command is in bytes ?
2)( if the above assumption is correct)
I have checked openfiles under /opt(using command lsof /opt) and found the total size of all the open files is 128 GB , where my actual /opt partition size is 8 GB.

kindly help me .

thanks,
mayrus.
 
Old 04-27-2010, 07:18 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Indeed the size is in bytes. lsof doesn't report physical size for objects that don't have one (for example sockets, pipes, block devices and so on). In some cases it reports the size of the I/O buffers or the byte offset. Despite these (in some degree) obscure concepts, you can force to report the true size (where available) using the -s option. Said this, how did you compute the total size?

I would end up with something like this:
Code:
lsof -s /opt | awk 'NR > 1{total+=$7} END{print total}'
provided the SIZE is the 7th column in the lsof's output.
 
Old 07-22-2014, 07:03 AM   #3
trancephorm
Member
 
Registered: Nov 2004
Posts: 34

Rep: Reputation: 0
sudo lsof -s | grep -i deleted | awk 'NR > 1{total+=$7} END{print total}'
71135016


... So I have 71 GB in deleted files for which it seems space cannot be recovered automatically... Is there a way to do it manually? Thanks...
 
Old 07-22-2014, 09:05 AM   #4
trancephorm
Member
 
Registered: Nov 2004
Posts: 34

Rep: Reputation: 0
It's me again..... was reading something around, and it seems that you cannot extend ext4 to the left, just to the right... seems that extra 50 GB can't be acquired that way...
 
Old 07-22-2014, 01:45 PM   #5
trancephorm
Member
 
Registered: Nov 2004
Posts: 34

Rep: Reputation: 0
given up... succesfully restored / filesystem to freshly created ext4 using this: http://crunchbanglinux.org/wiki/howt...ing_fsarchiver, now df free size is reported ok.

anyways, thanks to all that tried to help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Description of mpstat output Sapfeer Linux - Newbie 4 02-22-2010 11:24 PM
how to read lsof output command many file open by root ??? b-RAM Linux - Newbie 2 10-05-2009 02:40 AM
Active connections conundrum involving lsof / netstat output uncle-c Linux - Newbie 8 12-09-2007 10:56 AM
Stat command output description jackloo Linux - Newbie 2 09-28-2007 08:31 AM
Looking for a Description of CPU Flags in cat /proc/cpuinfo Output weibullguy Linux - General 1 06-08-2006 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration