Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-14-2011, 06:09 AM   #1
LQ Newbie
Registered: Sep 2003
Location: Boise
Posts: 11

Rep: Reputation: 0
Partition on an existing system - extended not being used

I have a 120GB HD that I installed my linux-mint distro to and have been using for a while now, maybe a year or so. However, it has been running great so I haven't paid much attention to the actual install. Recently, I have been getting notifications of very low disk space remaining. I ran gparted and discovered that there is a very large extended partition that doesn't appear to be mounted.
Can I just boot into a terminal, set a mount point and be on my way or will this hurt my existing installation?
What is the safest set of steps to mount this partition since it looks to be the swap space as well?

Here is output of fdisk for the drive:
Disk /dev/sdb: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000010f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1459    11717632   83  Linux
/dev/sdb2            1460       14947   108340225    5  Extended
/dev/sdb5            1460       14947   108340224   82  Linux swap / Solaris
Thanks for any and all help.

Last edited by knipknup; 07-14-2011 at 06:14 AM.
Old 07-14-2011, 06:44 AM   #2
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389

Are you talking about /dev/sdb2 or /dev/sdb5?

You cannot mount /dev/sdb2, this is a container that holds all the logical partitions (jus one in your case, /dev/sdb5).

Have a look here for a more elaborate explanation: Primary, Extended and Logical Partitions

Hope this helps.
Old 07-14-2011, 06:57 AM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,797

Rep: Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158
Holy mackerel !!!. That has go to be the biggest swap (and waste of space) I think I've ever seen.
After a clean reboot, "sudo swapoff", then delete that swap partition (/dev/sda5). Create a new one (couple of Gig say), then swapon. Use all that (now) free space to create logical partitions and mount them appropriately.

Old 07-14-2011, 07:48 AM   #4
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
druuna and syg00, you both beat me to the punch. Man, I just type too slow.

knipknup, you'll want to do as syg00 suggested, and reduce your swap to a size that is reasonable. The logical partition(s) you create will then start at /dev/sdb6 and will be within that extended partition along with your /dev/sdb5 swap.

This is just a matter of logistics, but with all of these types of disk resizing exercises, the devil is in the detail.

Look at your /etc/fstab file to see how your swap is defined. If it looks like this,
/dev/sdb5         swap                    swap    defaults        0 0
you are all set to just create another appropriately sized /dev/sdb5 swap partition.

sudo swapoff /dev/sdb5
sudo fdisk /dev/sdb
sudo mkswap /dev/sdb5
sudo swapon -a
'swapon -s' will show you it is swapped on properly.
[tommy@athlon ~]$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       6291452 0       -1
If your /etc/fstab entry for the swap partition starts with UUID= or LABEL=, use that information and either the '-L' or '-U' flags of 'mkswap' so that your swap file and fstab entry match.

I don't know Mint and don't know if mounts and swapon's are done by LABEL or UUID (yet), but many distros are moving in that direction. It doesn't hurt to look. If the entry in fstab is wrong the worst that can happen is that no swap gets mounted ("swapped on") at boot time - a failed swapon doesn't prevent the system from coming up.

And just a question from me to all of the Mint literate out there, or for you, knipknup: where is /dev/sda? Just curious.

Last edited by tommylovell; 07-14-2011 at 07:53 AM.
Old 07-14-2011, 06:26 PM   #5
LQ Newbie
Registered: Sep 2003
Location: Boise
Posts: 11

Original Poster
Rep: Reputation: 0
Hey all, Thanks very much for the replies and help! I was able to get this corrected just as easily as you said. I even learned a bunch as I always do when hitting

For the question: "Where is /dev/sda?"

I have two hard drives and /dev/sda was the original linux install. However, something got fritzed in my install (or I wanted to try mint - I can't remember), so I installed fresh on the sdb and then copied all my data from sda to sdb. Then I erased sda and use it for backups and data storage.

Knowing I keep all my data on this second HD (sda), I was surprised the system drive (sdb) was so 'full'. It appears I did something funky with that install. I really like how this machine runs now, so I am hesitant to nuke all and start fresh.

I can now use the extended partition space and should be happy.

Thanks again for all the help.
Old 07-14-2011, 09:35 PM   #6
LQ Guru
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,286

Rep: Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384
If you look at the fdisk output, you can see that your drive is 122GB and your / partition is about 11GB and your Extended partition has one logical (swap) partition taking up the remainder of the drive, about111GB for a swap partition. Basically you created these backwards from the way the normally are. Normally, you wouldn't need more than 1-2GB swap for an average user.


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
[SOLVED] I need help converting a vfat extended partition into a ext4 partition zorro70 Linux - General 6 02-15-2011 08:55 PM
HowTo convert Primary Partition to Logical (ie move it inside the Extended Partition) Tom6 Linux - Software 3 11-29-2010 03:40 PM
extended sata partition shrunk at 15 partition limit, how to re-enlarge Siljrath Linux - General 3 06-02-2010 10:33 PM
Resized Existing Windows Partition Using QTParted; System now Fudged! Rott3nHippi3 Linux - Software 5 09-07-2007 02:07 PM
Help setting up Suse 10 partition on existing winXP system flanker12k Linux - Newbie 1 05-11-2006 02:50 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 PM.

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