LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-23-2010, 01:47 AM   #1
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Rep: Reputation: 15
how to check my disk free space


[root@linux root]# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 1276 4864 28828642+ f Win95 Ext'd (LBA)
/dev/hda3 14 395 3068415 83 Linux
/dev/hda4 396 526 1052257+ 82 Linux swap
/dev/hda5 1276 3187 15358108+ 7 HPFS/NTFS
/dev/hda6 3188 3249 497983+ 8e Linux LVM
/dev/hda7 3250 3311 497983+ 8e Linux LVM

Here /dev/hda5 taken of How much capacity for NTFS (need space in MB)
 
Old 04-23-2010, 01:53 AM   #2
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
Quote:
Originally Posted by sanjay2004 View Post
[root@linux root]# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 1276 4864 28828642+ f Win95 Ext'd (LBA)
/dev/hda3 14 395 3068415 83 Linux
/dev/hda4 396 526 1052257+ 82 Linux swap
/dev/hda5 1276 3187 15358108+ 7 HPFS/NTFS
/dev/hda6 3188 3249 497983+ 8e Linux LVM
/dev/hda7 3250 3311 497983+ 8e Linux LVM

Here /dev/hda5 taken of How much capacity for NTFS (need space in MB)
#df -H
 
Old 04-23-2010, 02:03 AM   #3
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
diskfree space

thanks for immediately reply

[root@linux root]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 3.1GB 1.3GB 1.7GB 44% /
/dev/hda1 104MB 16MB 83MB 16% /boot
none 259MB 0 259MB 0% /dev/shm
/dev/volgr01/lv01 21MB 14kB 20MB 1% /home/user1

[root@linux root]# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 1276 4864 28828642+ f Win95 Ext'd (LBA)
/dev/hda3 14 395 3068415 83 Linux
/dev/hda4 396 526 1052257+ 82 Linux swap
/dev/hda5 1276 3187 15358108+ 7 HPFS/NTFS
/dev/hda6 3188 3249 497983+ 8e Linux LVM
/dev/hda7 3250 3311 497983+ 8e Linux LVM

Partition table entries are not in disk order

here i want to know the capacity /dev/hda4 in MB
 
Old 04-23-2010, 02:08 AM   #4
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
Quote:
Originally Posted by sanjay2004 View Post
thanks for immediately reply

[root@linux root]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 3.1GB 1.3GB 1.7GB 44% /
/dev/hda1 104MB 16MB 83MB 16% /boot
none 259MB 0 259MB 0% /dev/shm
/dev/volgr01/lv01 21MB 14kB 20MB 1% /home/user1

[root@linux root]# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 1276 4864 28828642+ f Win95 Ext'd (LBA)
/dev/hda3 14 395 3068415 83 Linux
/dev/hda4 396 526 1052257+ 82 Linux swap
/dev/hda5 1276 3187 15358108+ 7 HPFS/NTFS
/dev/hda6 3188 3249 497983+ 8e Linux LVM
/dev/hda7 3250 3311 497983+ 8e Linux LVM

Partition table entries are not in disk order

here i want to know the capacity /dev/hda4 in MB
Try this:
Quote:
#df -H /dev/hda4
 
Old 04-23-2010, 02:12 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

/dev/hda4 is a swap partition. I don't think it will show up when using the df command.

These size will show up in the top and free command (that is assuming you know hda4 is swap, which you do now ).

Hope this helps.
 
Old 04-23-2010, 02:15 AM   #6
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
If its the swap partition, you can use the following command to view it in MB:
Quote:
#free -m
But df -h /dev/hda4 will work as well.
 
Old 04-23-2010, 02:19 AM   #7
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
[root@linux root]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 3.1GB 1.3GB 1.7GB 44% /
/dev/hda1 104MB 16MB 83MB 16% /boot
none 259MB 0 259MB 0% /dev/shm
/dev/volgr01/lv01 21MB 14kB 20MB 1% /home/user1


[root@linux root]# fdisk

Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
[root@linux root]# fdisk /dev/hda

The number of cylinders for this disk is set to 4865.
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): n
First cylinder (3312-4864, default 3312):

here how much available space in MB ( how to calculate the cylinder in Bytes )
 
Old 04-23-2010, 02:32 AM   #8
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
Quote:
Originally Posted by sanjay2004 View Post
[root@linux root]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 3.1GB 1.3GB 1.7GB 44% /
/dev/hda1 104MB 16MB 83MB 16% /boot
none 259MB 0 259MB 0% /dev/shm
/dev/volgr01/lv01 21MB 14kB 20MB 1% /home/user1


[root@linux root]# fdisk

Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
[root@linux root]# fdisk /dev/hda

The number of cylinders for this disk is set to 4865.
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): n
First cylinder (3312-4864, default 3312):

here how much available space in MB ( how to calculate the cylinder in Bytes )
here I'd suggest you to first check the available space (I can see you have the 40GB hdd and your used space is around 3.3 GB so you can create new partitions from the rest space available)and then determine how much space you want to take for new partition.
If a 100 MB partition is needed, it can done in the following way:

Quote:
[root@linux root]# fdisk /dev/hda

The number of cylinders for this disk is set to 4865.
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): n
[SIZE="3"]First cylinder (3312-4864, default 3312): (press enter here)
Last cylinder or +size or +sizeM or +sizeK (2057-5005,default 5005):+100M
then press wq to save and exit.

Run this command after creating the partition :
Quote:
#partprobe /dev/hda
Create filesystem and you are done.

Last edited by Sayan Acharjee; 04-23-2010 at 02:48 AM.
 
Old 04-24-2010, 12:09 AM   #9
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
/dev/hda5 1276 3187 15358108+ 7 HPFS/NTFS

what about this as shown in fdisk -l?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 12:57 PM
How to check the free space available on the whole disk ? victvishwa Linux - Server 20 06-15-2009 05:26 PM
how do you check the free space mahmoud Linux - Newbie 2 01-03-2008 10:32 AM
how to do a free space regular check baronlynx Linux - General 1 10-04-2005 07:01 PM
How to check free disk space TigerLinux Linux - Newbie 9 10-04-2005 05:04 PM


All times are GMT -5. The time now is 12:14 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration