LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-31-2006, 08:26 AM   #1
wimnat
Member
 
Registered: Dec 2004
Location: Sydney, AU
Distribution: CentOS 5.x, Backtrack
Posts: 72

Rep: Reputation: 16
Question Retrieving free space in linux / partitioning


I installed Red Hat linux and when it came to partitioning, i left 20 GB of free space because i wasn't quite sure how i wanted to split that 20 GB up at the time.

Now i have decided i want a 10GB and 2x 5GB partitions. No problem - fdisk is the answer. Or so i thought. For some reason fdisk refuses to let me touch the free space. I'm not at all sure why. Any ideas?

[root@tigpr8 mnt]# df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/hda2 35971 17840 16304 53% /
/dev/hda1 97 15 78 16% /boot
none 1004 0 1004 0% /dev/shm

[root@tigpr8 mnt]# fdisk /dev/shm
You will not be able to write the partition table.

Unable to read /dev/shm

[root@tigpr8 mnt]# fdisk shm

Unable to open shm

 
Old 01-31-2006, 08:56 AM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
The space on /dev/shm (shared memory) is not in any hard disk, but in main RAM memory !
It can be used as a temporary space that is erased at boot time.
The main purpose, as far I know, is to provide a transient space for programs exchange data or for temporary files created by user scripts.
 
Old 01-31-2006, 08:59 AM   #3
wimnat
Member
 
Registered: Dec 2004
Location: Sydney, AU
Distribution: CentOS 5.x, Backtrack
Posts: 72

Original Poster
Rep: Reputation: 16
Ah ok well then that is to do with vmware i was running.

Ok so now ignoring the shm stuff... where the hell is my free space?
 
Old 01-31-2006, 09:32 AM   #4
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Do

fdisk -l

and we'll all have a better idea...
 
Old 01-31-2006, 09:34 AM   #5
wimnat
Member
 
Registered: Dec 2004
Location: Sydney, AU
Distribution: CentOS 5.x, Backtrack
Posts: 72

Original Poster
Rep: Reputation: 16
[root@tigpr8 mnt]# fdisk -l

Disk /dev/hda: 61.4 GB, 61492838400 bytes
16 heads, 63 sectors/track, 119150 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 203 102280+ 83 Linux
/dev/hda2 204 74453 37422000 83 Linux
/dev/hda3 74454 78516 2047752 82 Linux swap


This is just the partitions i created at boot time. It doesn't show any unallocated space
 
Old 01-31-2006, 09:36 AM   #6
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
"fdisk -l" (as root) will give you partitions table for all disks you may have in your computer. Maybe the free space you are looking for is in an un-partitioned space.
 
Old 01-31-2006, 09:39 AM   #7
wimnat
Member
 
Registered: Dec 2004
Location: Sydney, AU
Distribution: CentOS 5.x, Backtrack
Posts: 72

Original Poster
Rep: Reputation: 16
Ah i thought df showed everything. It's ok now - i have gone into hda with fdisk and i can see that i have free blocks so i have created a new partition there.

Thanks for the help
 
Old 01-31-2006, 09:43 AM   #8
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
lots of space

ops, my previous post came a bit late
Sure you have a lot of space ! It isjust waiting for you !

Take a look at fdisk's output. It says your disk has 119150 cylinders. The last partition, hda3 just finish at cylinder number 78516, so there are 40634 unused cylinders (~34% free).

I suggest you create a extended partition on hda4. After that you can create several partitions to use those 40634 cylinders.

regards,
 
Old 01-31-2006, 09:49 AM   #9
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Ah, yes, it's on the end of that drive... you have only used 78526 cylinders of 119096...

You'll have to create an extended partion /dev/hda4 then divide that up into logical partitions of whatever size you want... They will be /dev/hda5 and /dev/hda6 if you want two partitions... You can then format /dev/hda5 and /dev/hda6 with whatever filesystem you want...

You won't use /dev/hda4 as such as it's just an extended partition to hold the logical drives... You use hda5 and hda6. You have to do it that way as you can only have 4 primary partitions.
 
Old 01-31-2006, 09:51 AM   #10
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Quote:
Originally Posted by wimnat
Ah i thought df showed everything. It's ok now - i have gone into hda with fdisk and i can see that i have free blocks so i have created a new partition there.

Thanks for the help
Make sure you create an extended partition so you can add the two drives you want... If you created a primary, you can delete that and create an extended, then add logical partitions - as many as you want...
 
Old 02-01-2006, 02:30 AM   #11
wimnat
Member
 
Registered: Dec 2004
Location: Sydney, AU
Distribution: CentOS 5.x, Backtrack
Posts: 72

Original Poster
Rep: Reputation: 16
Thanks guys. I created the extended partition and then 3 partitions in that. 1 10gb and 2 5gb. I wanted the 5gb partitions to be raw so i chose "empty" as the filesystem type. I think that is right....
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Free space wiping in Linux? IamI Linux - Software 15 01-30-2012 09:03 AM
Partitioning Free Space cootetom Debian 17 02-26-2005 06:10 AM
Not enough free space on hard drive with 50g of free space??? auoq SUSE / openSUSE 5 10-13-2004 08:21 PM
Partitioning a drive for spare free space...SuSE 9.0 Thaidog Linux - Newbie 1 08-16-2004 10:30 AM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:54 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