Link to home
Start Free TrialLog in
Avatar of kurajesh
kurajesh

asked on

Linux Free Space

hi,

how to find out the free space in a linux system. i have a server where i know that there are free spaces available but df -kh and fdisk -l doent diaply exactly the free space info

how to find out the exact free space info
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

df -kh will show the filesystems that are created and mounted.

fdisk should show you the partitions created on the disk but the free disk space (not partitioned) I think needs to be calculated
Hi,

You can use following commands :

# df -h ( in MB and GB )
# df -ig ( For inode )

Once you find the partition, use "du -sh" to find the size of folder and files

Secondly, if you are trying to that you HDD is 100 GB and showing somewhere around 96GB, do not worry, 4GB used by Linux OS that we call it "File System Area"

 
Avatar of kurajesh
kurajesh

ASKER


i did try with df -h and the result is same as df -kh whereas i had kept additional space while buidling the server.

Note: Correct command for inode # df -i  
kurajesh, can you share you exact details, what you are trying to do ?

From you initial comments, it seem that you not able to see disk space.

i meant that total hdds' space is 1.2tb outof which 100gb i have not made a separate parition. rest 1.1tb has been paritioned and properly mounted. now when i df -kh i can see all 1.1tb perfectly but the 100gb is not showing in the table

its little bit tricky, us command fdisk command

# fdisk /dev/XXXX ( XXXX will be you HDD name )
# Press p ( for partition table )

You will see some values like :


Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0006cd01

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        9729   77943361   8e  Linux LVM

Check how may cylinders left and multiple by 512 ( treat as a example )


i just checked the table and output is as follows:


[root@localhost ~]# fdisk /dev/cciss/c0d0

The number of cylinders for this disk is set to 71380.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/cciss/c0d0: 587.1 GB, 587128266752 bytes
255 heads, 63 sectors/track, 71380 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1         255     2048256   83  Linux
/dev/cciss/c0d0p2             256       25751   204796620   83  Linux
/dev/cciss/c0d0p3           25752       41049   122881185   83  Linux
/dev/cciss/c0d0p4           41050       71380   243633757+   5  Extended
/dev/cciss/c0d0p5           41050       53797   102398278+  83  Linux
/dev/cciss/c0d0p6           53798       60171    51199123+  83  Linux
/dev/cciss/c0d0p7           60172       61701    12289693+  82  Linux swap
/dev/cciss/c0d0p8           61702       62976    10241406   83  Linux

Command (m for help): q

[root@localhost ~]# fdisk /dev/cciss/c0d1

The number of cylinders for this disk is set to 72937.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/cciss/c0d1: 599.9 GB, 599932581888 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p1   *           1       25496   204796588+  83  Linux
/dev/cciss/c0d1p2           25497       50992   204796620   83  Linux
/dev/cciss/c0d1p3           50993       63740   102398310   83  Linux

Command (m for help): q

[root@localhost ~]#


from the above how can i find that unassigned space
ASKER CERTIFIED SOLUTION
Avatar of Abhishek_Chib
Abhishek_Chib
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks abhishek,
now it is clear, how we can allocate this 9197 + 8100 (170gb) into a new single partition as they are from c0d0 and c0d1

For using space from two different disks to one partition you have to use LVM for the same.

If you have need any help to create that you can ask us and also add the output of df -Th command in you require help to configure LVM.
I would prefer to configure lvm and can you let me know how can I got qbout this. Also how can I configure a script to have complete file system backup.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i will certainly try this lvm and update quickly, thanks a lot
the lvm details were useful, completed the setup, thanks a lot abhishek & upanwar