LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Resizing / on encrypted system [debian jessie, ext4, lvm(?)] (https://www.linuxquestions.org/questions/linux-newbie-8/resizing-on-encrypted-system-%5Bdebian-jessie-ext4-lvm-%5D-4175497606/)

iwtbf 03-09-2014 01:16 PM

Resizing / on encrypted system [debian jessie, ext4, lvm(?)]
 
Ok, so I have no space left but plenty in /home. I would like to enlarge root somewhat.

I have googled on this problem and found some solutions but I'm a bit scared to try them out because when I installed jessie I choose to encrypt my system, I'm worrying if this might mess things up. Also I don't know if I have LVM or not.

What is the best way to do this in my particular situation?

Some information:

df-h
Code:

Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/computer--vg-root  9.1G  8.6G  52K 100% /
udev                          10M    0  10M  0% /dev
tmpfs                        713M  768K  712M  1% /run
tmpfs                        5.0M    0  5.0M  0% /run/lock
tmpfs                        1.4G  688K  1.4G  1% /run/shm
/dev/sda2                    229M  29M  188M  14% /boot
/dev/sda1                    487M  136K  486M  1% /boot/efi
/dev/mapper/computer--vg-home  893G  223G  626G  27% /home
tmpfs                        4.3G  52K  4.3G  1% /tmp
none                        4.0K    0  4.0K  0% /sys/fs/cgroup

df -T
Code:

Filesystem                  Type    1K-blocks      Used Available Use% Mounted on
/dev/mapper/computer--vg-root ext4      9480420  8975748        48 100% /
udev                        devtmpfs    10240        0    10240  0% /dev
tmpfs                      tmpfs      729412      772    728640  1% /run
tmpfs                      tmpfs        5120        0      5120  0% /run/lock
tmpfs                      tmpfs      1458820      424  1458396  1% /run/shm
/dev/sda2                  ext2        234153    29524    192137  14% /boot
/dev/sda1                  vfat        497696      136    497560  1% /boot/efi
/dev/mapper/computer--vg-home ext4    936109056 233065532 655468896  27% /home
tmpfs                      tmpfs      4474280        52  4474228  1% /tmp
none                        tmpfs            4        0        4  0% /sys/fs/cgroup


fdisk -l
Code:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1  1953525167  976762583+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/sda3_crypt: 999.4 GB, 999434485760 bytes
255 heads, 63 sectors/track, 121507 cylinders, total 1952020480 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/sda3_crypt doesn't contain a valid partition table

Disk /dev/mapper/computer--vg-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/computer--vg-root doesn't contain a valid partition table

Disk /dev/mapper/computer--vg-swap_1: 15.4 GB, 15439233024 bytes
255 heads, 63 sectors/track, 1877 cylinders, total 30154752 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/computer--vg-swap_1 doesn't contain a valid partition table

Disk /dev/mapper/computer--vg-home: 974.0 GB, 973992886272 bytes
255 heads, 63 sectors/track, 118414 cylinders, total 1902329856 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/computer--vg-home doesn't contain a valid partition table

mount
Code:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=909618,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=729412k,mode=755)
/dev/mapper/computer--vg-root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
pstore on /sys/fs/pstore type pstore (rw,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1458820k)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda2 on /boot type ext2 (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)
/dev/mapper/computer--vg-home on /home type ext4 (rw,relatime,data=ordered)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=4474280k)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type tmpfs (rw,relatime,size=4k,mode=755)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,name=systemd)

Any help would be highly appreciated!

evo2 03-09-2014 06:06 PM

Hi,

you can do this. I did basically the same install, encryption with lvm and then later shrank home by 10G and then extended root by 10G. The basic procedure is as follows

- unmount /home
- shrink home filesystem (use resize2fs)
- shrink home logical volume (use lvresize)
- mount /home/
- expand root logical volume (use lvresize)
- expand root filesystem (use resize2fs)

Read the man pages of the above two commands, and also familiarize yourself with the lvdisplay and vgdisplay commands. You should also probably e2fsck your home partition before and after resizing the filesystem.

Post back if you have more questions.

HTH,

Evo2.

iwtbf 03-11-2014 07:08 AM

Thank you so much! It worked like a charm!


All times are GMT -5. The time now is 09:39 AM.