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

20th November 2011, 07:20 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 110

|
|
|
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 ~]$
|
|

20th November 2011, 07:25 AM
|
 |
Registered User
|
|
Join Date: Jun 2008
Location: Russia
Age: 25
Posts: 515

|
|
|
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
|

20th November 2011, 07:42 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 110

|
|
|
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.
|

20th November 2011, 08:58 AM
|
|
Registered User
|
|
Join Date: Apr 2010
Location: London
Posts: 46

|
|
|
Re: partitions and logical volumes help
try gparted it might help you....
|

20th November 2011, 09:04 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 110

|
|
|
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?
|

20th November 2011, 02:15 PM
|
|
Registered User
|
|
Join Date: Jan 2011
Location: Woonsocket, RI
Posts: 390

|
|
|
Re: partitions and logical volumes help
Quote:
Originally Posted by jan1024188
|
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
try gparted it might help you....
|
GParted doesn't understand LVMs, so it won't help.
|

20th November 2011, 02:24 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 110

|
|
|
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.
|

20th November 2011, 08:30 PM
|
|
Registered User
|
|
Join Date: Jan 2011
Location: Woonsocket, RI
Posts: 390

|
|
|
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.
|

20th November 2011, 08:32 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 110

|
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 04:45 (Thursday, 20-06-2013)
|
|
 |
 |
 |
 |
|
|