Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 20th November 2011, 07:20 AM
jan1024188 Offline
Registered User
 
Join Date: Nov 2006
Posts: 110
linuxfirefox
partitions and logical volumes help

Ok, so I let fedora 16 use whole disk in installation, but It made some stupid stuff with the space.

As I have 64gb SSD, I am very space restricted.

What it did, is create 3 LVM's and assign 11gb to SWAP, 35gb to / (root) and 18gb to /home which is ridiculous.


So I am wondering, how can I reduce swap to 2gb, /root to 10gb and assign rest to /home?

Bellow is my fdisk-l:
Quote:
Disk /dev/mapper/vg_janpc-lv_swap: 10.5 GB, 10502537216 bytes
255 heads, 63 sectors/track, 1276 cylinders, total 20512768 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_janpc-lv_swap doesn't contain a valid partition table

Disk /dev/mapper/vg_janpc-lv_root: 35.3 GB, 35332816896 bytes
255 heads, 63 sectors/track, 4295 cylinders, total 69009408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_janpc-lv_root doesn't contain a valid partition table

Disk /dev/mapper/vg_janpc-lv_home: 17.6 GB, 17649631232 bytes
255 heads, 63 sectors/track, 2145 cylinders, total 34471936 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_janpc-lv_home doesn't contain a valid partition table


---------- Post added at 11:20 PM ---------- Previous post was at 11:00 PM ----------

I think I figured it out, and it was super easy. LVM's are really cool xD
Quote:
[jan@janpc ~]$ sudo lvreduce -L-25G /dev/vg_janpc/lv_root
WARNING: Reducing active and open logical volume to 7.91 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_root? [y/n]: y
Reducing logical volume lv_root to 7.91 GiB
Logical volume lv_root successfully resized
[jan@janpc ~]$ sudo lvreduce -L-7G /dev/vg_janpc/lv_swap
WARNING: Reducing active and open logical volume to 2.78 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_swap? [y/n]: y
Reducing logical volume lv_swap to 2.78 GiB
Logical volume lv_swap successfully resized
[jan@janpc ~]$ sudo lvextend -L+32G /dev/vg_janpc/lv_home
Extending logical volume lv_home to 48.44 GiB
Logical volume lv_home successfully resized
[jan@janpc ~]$
Reply With Quote
  #2  
Old 20th November 2011, 07:25 AM
Keldorn's Avatar
Keldorn Offline
Registered User
 
Join Date: Jun 2008
Location: Russia
Age: 25
Posts: 515
linuxchrome
Re: partitions and logical volumes help

Hi!
As i remember you should do following things:
1) umount swap partition
2) run lvreduce on that swap lv
3) run lvresize on swap lv
4) umount home partition
5) run fsck on that volume
6) run lvresize - to increase available space
7) run resize2fs on home volume
Mount home partition and swap partitions
p.s. oops, too late
Reply With Quote
  #3  
Old 20th November 2011, 07:42 AM
jan1024188 Offline
Registered User
 
Join Date: Nov 2006
Posts: 110
linuxfirefox
Re: partitions and logical volumes help

Yeh I ****ing broke something...
http://www.shrani.si/f/M/a/4DSY6EyH/dsc0146.jpg

How do I fix it from here on?

---------- Post added at 11:42 PM ---------- Previous post was at 11:31 PM ----------

Ok, I booted live CD and reversed the commands, now how do I properly do this thing? I wlll follow this guide instead of previous one now. http://blog.shadypixel.com/how-to-sh...volume-safely/

Last edited by jan1024188; 20th November 2011 at 07:46 AM.
Reply With Quote
  #4  
Old 20th November 2011, 08:58 AM
foottuns Offline
Registered User
 
Join Date: Apr 2010
Location: London
Posts: 46
windows_7firefox
Re: partitions and logical volumes help

try gparted it might help you....
Reply With Quote
  #5  
Old 20th November 2011, 09:04 AM
jan1024188 Offline
Registered User
 
Join Date: Nov 2006
Posts: 110
linuxfirefox
Re: partitions and logical volumes help

My swap seems to be corrupt, should I delete it and re-create new one?
Quote:
[root@localhost /]# swapoff -a
[root@localhost /]# e2fsck -f /dev/vg_janpc/lv_swap
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/vg_janpc/lv_swap

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

[root@localhost /]#
If so, how do I do it correctly so it will be LV?
Reply With Quote
  #6  
Old 20th November 2011, 02:15 PM
srs5694 Offline
Registered User
 
Join Date: Jan 2011
Location: Woonsocket, RI
Posts: 390
linuxfirefox
Re: partitions and logical volumes help

Quote:
Originally Posted by jan1024188 View Post
Yeh I ****ing broke something...
http://www.shrani.si/f/M/a/4DSY6EyH/dsc0146.jpg

How do I fix it from here on?
The lvresize command resizes the logical volume but does not touch whatever's inside it -- that is, the filesystem or swap space. To do the job properly, you must use resize2fs or equivalent commands for whatever filesystem or swap space the logical volume contains. Note that you've got to resize the filesystem first if you're shrinking the volume, but grow the volume first if you're increasing its size. Alternatively, there are tools, such as kvpm and system-config-lvm, can automatically combine the commands, thus minimizing the risk of creating problems by forgetting to do something.

In your case, you may have already done some pretty bad damage to your filesystems, so simply reversing the damaging commands and re-doing them properly might still leave you in bad trouble. Since it sounds like you've just installed Linux, my advice is therefore to re-install it, only this time use the custom partitioning option to set up your partitions (and logical volumes, if you choose to use LVM) in the way you want from the start.

---------- Post added at 09:15 AM ---------- Previous post was at 09:14 AM ----------

Quote:
Originally Posted by foottuns View Post
try gparted it might help you....
GParted doesn't understand LVMs, so it won't help.
Reply With Quote
  #7  
Old 20th November 2011, 02:24 PM
jan1024188 Offline
Registered User
 
Join Date: Nov 2006
Posts: 110
linuxfirefox
Re: partitions and logical volumes help

No, it didn't do any damange. I just reversed commands and re-did it properly, everything works fine. Except swap seems to have bad cluster, but other than that the system is perfectly fine.
Reply With Quote
  #8  
Old 20th November 2011, 08:30 PM
srs5694 Offline
Registered User
 
Join Date: Jan 2011
Location: Woonsocket, RI
Posts: 390
linuxfirefox
Re: partitions and logical volumes help

You can't be sure that no damage was done. Even if an fsck turns up OK, it could be that you damaged some data in one or more of your files while the system was misconfigured. Maybe you lucked out, but if it was me, I'd re-install. It'll take just a few minutes and guarantee that you won't have problems down the line because of undetected damage.
Reply With Quote
  #9  
Old 20th November 2011, 08:32 PM
jan1024188 Offline
Registered User
 
Join Date: Nov 2006
Posts: 110
linuxfirefox
Re: partitions and logical volumes help

Well corrupt system files would probably result in failure to execute rather than strange behavour, therefore Im sure I'll be fine. If some app would be broken Id just reinstall it. Its probably just few blocks that were cropped out, but rest of fs was intacted. And Im stoned, so Im not sure what I wrote :P
Reply With Quote
Reply

Tags
logical, partitions, volumes

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] boot can't access ext4 partitions on LVM logical volumes on RAID array bbobbo Using Fedora 1 9th February 2011 06:13 PM
New Logical Volumes midlandscc Installation and Live Media 2 5th June 2010 01:20 PM
reading linux partitions from windows (logical volumes?) jacobsh Using Fedora 7 25th March 2009 06:40 AM
2 logical volumes maalamaal Using Fedora 8 25th February 2009 01:04 PM
Disk Partitions and Logical Volumes carl h Using Fedora 0 15th August 2005 01:36 PM


Current GMT-time: 04:45 (Thursday, 20-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat