LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-25-2011, 06:08 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
make a swap partition


I had trouble installing Ubuntu, because I had no swap.

I had sda1 Windows 32GB, sda2 boot 500MB then a lvg with Fedora 15 about 280GB. Fedora didn't ask for a swap, but Ubuntu said the installation will probably fail if there is no swap.

gparted would not touch the lvg, said it couldn't.

How could I have shrunk the lvg and created 2 roughly 140GB partitions and a 2GB swap?

In the end I used the Win install dvd, rewrote everything, which meant of course reinstalling everything!
 
Old 09-25-2011, 07:13 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

As you said that you already re-installed everything I can only point out the things that could try next time if it happens:

1. Every linux OS create swap partition. Not sure, when you say Fedora didn't create one.
2. The reason that I can think of why you were not able to shring that lvg because / file system was part of it.
3. You could have tried removing only Linux related partition and created swap partition manually for Ubuntu to use. Ofcourse this would have taken your Fedora install but would have saved Windows install.
 
Old 09-25-2011, 07:40 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
LVMs basic premise was that it'd be really nifty if you could expand filesystems by adding new partition(s) easily. Worked fine till people wanted to remove space - especially remove it from LVM altogether like you do. Slight oversight that took too long to fix.
tldp.org has a good LVM howto - go have a read of that.
Fedora would have created a root and a swap logical volume in that vg. Getting Ubuntu installer to recognise that would be an effort.
From the (install) Fedora disk in rescue mode, you'd need to have reduced the size of the root filesystem, reduced the lv, reduced the vg, then the pv. ta-da, lots of unpartitioned space.
Personally I would have moved the swap outside the pv at that point, and then both could use it. As would the Ubuntu installer.

Fedora will happily install without LVM - I'm not a fan in case you didn't guess.
 
Old 09-25-2011, 08:32 PM   #4
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
I've done a few installs lately, 'cos of problems, and I haven't been presented with the choice of not using lvm. Fedora wants to set up a boot = 500MB and then merrily goes and lvms. Could I tell it not to? I didn't notice that.
 
Old 09-25-2011, 09:58 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
I find defaults rarely do what I need - see this. Custom layout lets you set up your own partitions.
 
Old 09-26-2011, 04:39 AM   #6
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Yeah, well custom ain't so bright either: I had sda1 32GB Win, sda2 100MB ntfs and free space 139000MB, then a lil swap and sda3 140GB I ran ubuntu onto sda3. It promptly made an lvg and created sda5 and sda 6 (1.6GB swap). Then I put in Fed 15 dvd, say please use free space. It can't, it just says 'not enough free space on disk' even when I tell it to create a lvg it keeps repeating no free space, although there is 139GB free.

I restarted Ubuntu, ran gparted, had to delete my lil swap 2GB then I could create another partition, sda4 I think, I can't remember now 4 I think. Now Fedora is installing on sda4

So swap counts as a partition and you can't have more than 4
 
Old 09-26-2011, 04:51 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Yes swap counts as a partition, but no, 4 ain't the limit.

A little more effort required - by you.
 
Old 09-26-2011, 09:14 AM   #8
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by Pedroski View Post
you can't have more than 4
You're limited to four primary partitions. An extended partition can have any number of logical partitions
 
Old 09-26-2011, 07:08 PM   #9
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
That doesn't make sense: I had 130+GB unused space, I tell it to make a lvg, it says there is no space left, ergo, I can't have any number of extended partitions.

Or should I have changed swap to an lvm, then it might have been able to extend into the unused space??
 
Old 09-26-2011, 07:49 PM   #10
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
An lvg is made up from existing partitions as near as I can figure it. It is not a true partition but can only exist in the space provided by existing partitions. (someone please correct me if I'm wrong as I've never used lvg)
It's normal to see an hdd with three primary partitions and one extended partition. The extended partition can have many logical partitions and that is where the swap will often be.
(technically, a primary partition is also a logical partition)
 
Old 09-26-2011, 07:55 PM   #11
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by Pedroski View Post
That doesn't make sense: I had 130+GB unused space, I tell it to make a lvg, it says there is no space left, ergo, I can't have any number of extended partitions.

?
Since an extended partition counts as a primary partition, you could theoretically have more than one. But since an extended partition can house any number of logical partitions, there is no reason to have more than one. Just make your fourth partition fill the empty space and you can put as many logical partitions in it as you need.
 
  


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
Why should we make SWAP partition twice as big as RAM ? dazzlinggopi Linux - Virtualization and Cloud 3 02-23-2011 01:38 PM
One swap partition for two linux systemsm how make that? sarajevo Linux - General 2 09-23-2007 02:17 PM
I forgot to make a swap partition Lokathor Debian 12 06-09-2006 11:34 PM
How to make a swap partition with mac-fdisk? PsychoSync Linux - Software 1 04-03-2005 06:58 PM
What size should I make my swap partition? bobotoes Linux - Newbie 7 09-30-2004 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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