LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 04-25-2014, 09:54 AM   #1
metrx
LQ Newbie
 
Registered: Feb 2014
Distribution: Debian AMD64
Posts: 7

Rep: Reputation: Disabled
Partion Resizing - Running out of space


Hey guys,

I am having a rather strange issue here. I recently run out of space on my / mount.
During a
Code:
aptitude dist-upgrade
on my Debian "3.12.3-031203-generic" /Testing x86_64 system.

Code:
[root]~ # df
Filesystem                 1K-blocks     Used Available Use% Mounted on
/dev/mapper/dbkakarot-root   9480420  9456848         0 100% /
udev                           10240        0     10240   0% /dev
tmpfs                         809092      880    808212   1% /run
tmpfs                           5120        0      5120   0% /run/lock
tmpfs                        1618180     2640   1615540   1% /run/shm
/dev/sda1                     233191    34985    185765  16% /boot
/dev/mapper/dbkakarot-home 454386112 29504076 401777524   7% /home
tmpfs                        4939200       60   4939140   1% /tmp
none                               4        0         4   0% /sys/fs/cgroup
As you can see "/dev/mapper/dbkakarot-root" is full.
Goal: I would like to increase the size to 20GB.

Code:
[root]~ # fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x000b1d94

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

Disk /dev/mapper/dbkakarot-root: 9999 MB, 9999220736 bytes
255 heads, 63 sectors/track, 1215 cylinders, total 19529728 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: 0x00000000

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

Disk /dev/mapper/dbkakarot-swap_1: 17.0 GB, 17003708416 bytes
255 heads, 63 sectors/track, 2067 cylinders, total 33210368 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: 0x00000000

Disk /dev/mapper/dbkakarot-swap_1 doesn't contain a valid partition table

Disk /dev/mapper/dbkakarot-home: 472.8 GB, 472844861440 bytes
255 heads, 63 sectors/track, 57486 cylinders, total 923525120 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: 0x00000000

Disk /dev/mapper/dbkakarot-home doesn't contain a valid partition table
gparted is also not very amused about this. I initially set up a LVM based partition during the installation of debian.

I guess the first step is to cancel the last
Code:
aptitude dist-upgrade
- is that possible?

Does anyone have an idea how I could increase the size of my /dev/mapper/dbkakarot-root?

Lastly, not sure if this helps, maybe for clarification:
Code:
[root]~ # ls -la /dev/mapper/
total 0
drwxr-xr-x  2 root root     120 Apr 25 14:35 .
drwxr-xr-x 17 root root    4200 Apr 25 14:42 ..
crw-------  1 root root 10, 236 Apr 25 14:35 control
lrwxrwxrwx  1 root root       7 Apr 25 14:35 dbkakarot-home -> ../dm-2
lrwxrwxrwx  1 root root       7 Apr 25 14:35 dbkakarot-root -> ../dm-0
lrwxrwxrwx  1 root root       7 Apr 25 14:35 dbkakarot-swap_1 -> ../dm-1
[root]~ # ls -la /dev/dm-*
brw-rw---- 1 root disk 252, 0 Apr 25 14:35 /dev/dm-0
brw-rw---- 1 root disk 252, 1 Apr 25 14:35 /dev/dm-1
brw-rw---- 1 root disk 252, 2 Apr 25 14:35 /dev/dm-2
 
Old 04-25-2014, 10:29 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,377

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
I don't use LVM but if I am reading your output correctly, your / partition is about 10GB and your swap is 17GB?? The rest is the /home. There are commands to resize LVM and in your case probably the /home, reduce it and then increase the /. I'm not familiar with LVM but you might do a search hear at LQ or gooogle something like 'how to resize LVM'.
 
Old 04-25-2014, 11:56 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,614

Rep: Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576
LVM makes it easy to add space to a filesystem, a real PITA not so easy to shrink one to free up some space. First, you need to shrink the /home filesystem by more than enough to free up the space. This part cannot be done while the filesystem is mounted. Either boot from a rescue disk to do it or drop back to a non-GUI runlevel and umount /home. This all assumes that the filesystems in use are ext2/3/4 (resize2fs does all of them). For others, you will have to substitute the appropriate resize tool.
Code:
fsck -f /dev/dbkakarot/home           # resize2fs will insist that this be done first
resize2fs /dev/dbkakarot/home 400G    # shrink by more than enough
lvresize --size -10G dbkakarot/home   # free up 10G to add to root
resize2fs /dev/dbkakarot/home         # let the filesystem fill the reduced LV
fsck -f /dev/dbkakarot/home           # make sure you didn't mess up
If that final fsck fails, it means you didn't shrink the filesystem enough in that second step. Undo the lvresize ("lvresize --extents +100%FREE dbkakarot/home"), re-run the fsck, and try again.

Now you have space to add to the root LV and filesystem.
Code:
fsck -f /dev/dbkakarot/root           # Again, resize2fs will insist
lvresize --extents +100%FREE /dev/dbkakarot/root
resize2fs /dev/dbkakarot/root
The expansion is much safer than the shrinking and can be done online, at least for some filesystems.

Last edited by rknichols; 04-25-2014 at 12:01 PM. Reason: add PITA remark
 
1 members found this post helpful.
  


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
Running out of space - resizing my existing Linux partition gljubuncic Linux - Software 7 07-01-2006 10:48 PM
Resizing a partion. pete1234 Linux - General 5 08-01-2005 11:19 AM
resizing a primary partion nanjil Linux - Newbie 4 07-27-2005 09:38 AM
? on resizing partion w/MandrakeMove eroica Mandriva 4 07-20-2004 04:14 PM
? on resizing partion w/MandrakeMove eroica Mandriva 0 05-13-2004 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 PM.

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