LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 03-17-2013, 05:02 AM   #1
joloboff
LQ Newbie
 
Registered: Apr 2012
Posts: 5

Rep: Reputation: Disabled
Resize Exended Partition with logical volume and ext4 file system


Hi,

I made the mistake to partition my disk with a first partition
that I do not want to change and a second extended partition that takes
all the remaining space (~700 GB) that is an extended partition
managed by Logical Volume and formatted as ext4

sudo fdisk -l
Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000ea3cf

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 1465147391 732322817 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 501760 1465147391 732322816 8e Linux LVM

Disk /dev/mapper/kubuntu-root doesn't contain a valid partition table

I do not understand why I have the message about not containing a valid
partition table. Can I do something about it ?
The partitioning was done automagically when I installed Kubuntu 12.10.
The extended partition is managed by logical volume
$ pvscan

PV /dev/sda5 VG kubuntu lvm2 [698.39 GiB / 0 free]
Total: 1 [698.39 GiB] / in use: 1 [698.39 GiB] / in no VG: 0 [0 ]

Now I want to shrink this partition, and it is used only 13%
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/kubuntu-root 712656568 84080712 592375000 13% /

So I have plenty of space to shrink.
The problem is that GParted does not allow me to do this!
GParted dialog box to resize partition tells me that the minimum size
is equal to the maximum size , equal to the partition size.
Therefore I cannot shrink it !

What can I do ?

Should I resize the logical volume first ?
resize the file system?

Of course, I want to do this without reformatting my extended
partition and restart everything from scratch.

I want to resize my LVM to a smaller size,
then resize the current extended partition to be smaller
and create a new partition at the end of disk.

What should I do ?
HELP !
 
Old 03-17-2013, 05:50 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
First thing - go back and use [code]...[/code] tags around the outputs in your initial post so we can read them.
Quote:
Disk /dev/mapper/kubuntu-root doesn't contain a valid partition table

I do not understand why I have the message about not containing a valid
partition table. Can I do something about it ?
This is an artefact of LVM - don't worry about it; nothing is wrong, nothing to fix.

tldp.org has a how-to for LVM - it discusses how to resize lv's safely. Redhat/Fedora also offer system-config-lvm as a GUI front-end - other distros may have similar.
There is no obvious need to reduce the extended, you could shrink the lv and simply use another logical(s) for your new partition(s). I find that a more flexible solution.
 
Old 03-18-2013, 08:03 PM   #3
joloboff
LQ Newbie
 
Registered: Apr 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
what to do ?

Hi,

Thanks for the reply.
So what is the next step for me ?
I suppose I should take a live CD, then
i should resize the file system, using which command to resize an ext4 fs ?
after I resize the file system, then I resize the logical volume
using lvreduce ??
after that Gparted will make it possible to create a new partition ?
I want to have a dual boot to
(a) boot from my current logical volume
or (b) boot from a new partition I want to create after my logical volume

How do I do that without deleting everything ?

Thanks for the help
-- vj
 
  


Reply

Tags
partioning


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
Resize the Logical volume navin.altair Linux - Hardware 2 02-16-2012 09:32 PM
How to Resize Root LVM Logical Volume??? jdupre Fedora 17 10-02-2010 07:21 AM
Having an issue in regards mounting a file system to a logical volume in RHEL5 crathm Linux - Newbie 6 01-28-2009 04:51 PM
How to resize a logical volume mounted as /var (FC9) prabhatsoni Linux - Hardware 10 01-04-2009 03:40 PM
LXer: What is the procedure to resize an LVM2 logical volume and the ext2 or ext3 fil LXer Syndicated Linux News 0 07-17-2008 03:50 AM


All times are GMT -5. The time now is 11:54 AM.

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