LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-06-2015, 11:48 PM   #1
l33y
Member
 
Registered: Jan 2014
Location: Gulf Coast, USA
Distribution: Xubuntu
Posts: 50
Blog Entries: 1

Rep: Reputation: Disabled
Xubuntu MBR partioning question


I was wondering if I can repair my current partitioning setup using gparted, or if I should just reload Xubuntu. Basically I screwed up by making the primary partition only 256M, and made a massive extended logical partition for everything else, and did not leave swap space. I am doing this on an older PC with MBR, dual processor, 2G RAM each processor, 160GB hard drive space. It is single boot, no Windows. I would like the partioning to be as follows, leaving empty disk space for other Linux flavors:

/ 13GB ext4
/home 50GB ext4
swap 8GB swap

sudo parted /dev/sda print all
Code:
Model: ATA ST3160812AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  256MB  255MB  primary   ext2         boot
 2      257MB   160GB  160GB  extended
 5      257MB   160GB  160GB  logical
                                                                       
Error: /dev/mapper/xubuntu--vg-swap_1: unrecognised disk label

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/xubuntu--vg-root: 158GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system  Flags
 1      0.00B  158GB  158GB  ext4
                                                                          
Error: /dev/mapper/sda5_crypt: unrecognised disk label
df -hT
Code:
Filesystem                   Type      Size  Used Avail Use Mounted on
/dev/mapper/xubuntu--vg-root ext4      145G  6.5G  131G   5% /
none                         tmpfs     4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         devtmpfs  989M  4.0K  989M   1% /dev
tmpfs                        tmpfs     201M  1.1M  200M   1% /run
none                         tmpfs     5.0M     0  5.0M   0% /run/lock
none                         tmpfs    1003M   88K 1003M   1% /run/shm
none                         tmpfs     100M   24K  100M   1% /run/user
/dev/sda1                    ext2      236M  120M  104M  54% /boot
/home/mbrk/.Private          ecryptfs  145G  6.5G  131G   5% /home/mbrk

Last edited by l33y; 05-07-2015 at 10:56 PM. Reason: added details
 
Old 05-07-2015, 01:29 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,842

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
I'm guessing that's a default install with LVM using all the disk - I'm also guessing you have swap already active. Re-arranging things might as you indicated get complicated. Let's see the following (sudo if necessary)
Code:
lsblk
swapon -s
free
BTW, pls use [code] tags when posting output; it keeps the layout for easier reading (edit your initial post as well)
 
1 members found this post helpful.
Old 05-07-2015, 03:17 AM   #3
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Ubuntu MATE, Mint MATE & antiX MX-15
Posts: 1,664
Blog Entries: 5

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
133y,

Personally I think you would be quicker doing a fresh install of Xubuntu.

It does not take long in any case.

There is no need to use 8GB for swap, 2GB maximum is fine.

Simply use 3 Primary (no LVM, no Extended) partitions as follows:

/ 13GB ext4
/home 56GB (i.e. remainder of disk) ext4
swap 2GB swap

Last edited by beachboy2; 05-07-2015 at 03:19 AM.
 
1 members found this post helpful.
Old 05-07-2015, 08:16 AM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
You can use gparted to resize partitions.
1 resize the partitions within extende & move to the right.
2. Resize extended from the left.
3. Resize / to right taking up all free space.
 
1 members found this post helpful.
Old 05-07-2015, 10:05 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
This is a frequent problem when users create a separate boot partition which is not large enough. Another option you have is to remove older kernels. See the Ubuntu documentation link below:

https://help.ubuntu.com/community/Lu...moveOldKernels
 
1 members found this post helpful.
Old 05-07-2015, 01:50 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,949

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Boot is only 54% used and 256M should be adequate. As stated the default install creates 2 partitions i.e. /boot and a LVM which includes /(root) and swap which uses the rest of the disk. You did not necessarily mess up but since you desire to install multiple distributions there isn't any free space.

gparted is capable of resizing LVM but since you are using encryption it complicates things a bit. I've never tried resizing anything with encryption yet so can not help much but as suggested it might be easier to just reinstall. Make sure you select "something else" to manually partition the drive. You can use traditional partitions instead of LVM but you will need the big extended to create more then 4 partitions.

Make sure to copy anything you do not want to loose before reinstalling or resizing.
 
1 members found this post helpful.
Old 05-07-2015, 10:47 PM   #7
l33y
Member
 
Registered: Jan 2014
Location: Gulf Coast, USA
Distribution: Xubuntu
Posts: 50
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
syg00, see output below. And thank you for the tip about using code quotations.

Many thanks to everyone. Each response was helpful. I am going to do backup using clonezilla, then resize with Gparted, and then probably reload Xubuntu. I saw information on Ubuntu and Fedora sites recommending that the swap partition be 2 times the RAM, that is why I chose 8G for swap, since I have dual processors of 2G RAM each. One thing I found interesting on my Xubuntu box with current partition setup: I tried to shrink a FAT partition to a thumb stick using Gparted, then add Linux ext 4 partition, and the computer locked up! I had to issue a kill command for Gparted. I was wondering if that had something to do with the lack of swap space. But I was able to repartition the thumb stick using my SysRescue CD on the same computer. Hm.

lsblk
Code:
NAME                            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                               8:0    0   149G  0 disk  
sda1                            8:1    0   243M  0 part  /boot
sda2                            8:2    0     1K  0 part  
sda5                            8:5    0 148.8G  0 part  
  sda5_crypt (dm-0)           252:0    0 148.8G  0 crypt 
    xubuntu--vg-root (dm-1)   252:1    0 146.8G  0 lvm   /
    xubuntu--vg-swap_1 (dm-2) 252:2    0     2G  0 lvm   
sr0                              11:0    1 422.5M  0 rom
sr0 is from the systemrescueCD

free
Code:
  total       used       free     shared    buffers     cached
Mem:       2053780    1398552     655228      62432      83188     731548
-/+ buffers/cache:     583816    1469964
Swap:            0          0          0
swapon -s
Code:
Filename				Type		Size	Used	Priority

Last edited by l33y; 05-07-2015 at 10:54 PM.
 
Old 05-08-2015, 12:56 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,842

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
I'm not a fan of re-installing - you don't learn much that way.
You have a 2G swap lv under LVM - should be plenty big enough. The 2xRAM recommendation died out with the dodo. Don't know why you aren't using it, but maybe mkswap was never run. What does /etc/fstab have in it ?. gparted shouldn't really need swap unless memory is tight - however, I always prefer to use a liveCD to ensure none of the filesystems I want to play with are mounted.
BTW, you have 2G of memory - total. It's not "per CPU".
 
1 members found this post helpful.
Old 05-08-2015, 09:24 AM   #9
sudowtf
Member
 
Registered: Nov 2013
Posts: 187

Rep: Reputation: 45
Quote:
Originally Posted by l33y View Post
[...] I tried to shrink a FAT partition to a thumb stick using Gparted, then add Linux ext 4 partition, and the computer locked up! [...]
Please realize USB is overly slow, and it may have just stalled while data was being relocated. (The system will indeed seem locked up; if you can move windows, or mouse/type in other programs, even if stuttering, then just wait it out.)

Please note "Shrinking" could also cause data loss.
 
1 members found this post helpful.
Old 05-09-2015, 02:31 PM   #10
l33y
Member
 
Registered: Jan 2014
Location: Gulf Coast, USA
Distribution: Xubuntu
Posts: 50
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
sudowtf, thank you for the advice. I will wait longer next time. I like syg00's recommendation to only run gparted from a live disk, which seemed much safer and faster. Thank you for the advice, sys00. I tried to repartition with gparted, but I was unable to shrink the encrypted partition. Under the information tab, when I highlighted the partition, I received a message "linux Unified key setup encryption is not yet supported".

I then deleted each partition, and rebooted the install CD and select "something else", thanks michaelk. I set up the following partition scheme. Here is what I have now:

lsblk
Code:
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0   149G  0 disk 
├─sda1   8:1    0  12.1G  0 part /
├─sda2   8:2    0     1K  0 part 
├─sda5   8:5    0  46.6G  0 part /home
└─sda6   8:6    0   3.7G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom
Thanks for all of your help!
 
  


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
40 Gb HD partioning question cre8tivspirit Linux - Newbie 3 02-26-2008 09:57 AM
Just about to start, partioning question, please BobNutfield Linux From Scratch 4 05-06-2006 05:15 AM
Partioning question testforechozero Linux - General 1 07-21-2005 09:51 PM
Yet Another Partioning Question mykrob Linux - General 3 08-12-2004 01:51 PM
Yet another partioning question mwjeff Debian 12 03-14-2004 01:33 PM


All times are GMT -5. The time now is 10:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration