Ask Your Question
0

Partition resize question/issue

asked 2018-10-16 10:40:19 -0500

lhirlimann gravatar image

updated 2018-10-16 16:13:32 -0500

ozeszty gravatar image

Hi ,

I'm installing Fedora 28 server aarch64 on my raspberry pie 3b+. I'm following the wiki (https://fedoraproject.org/wiki/Archit...) but something goes wrong. I only get 1/2 of the size of my SD Card. Install log is at https://paste.fedoraproject.org/paste....

I now have :

[ludovic@localhost ~]$ df -H
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 459M     0  459M   0% /dev
tmpfs                    504M     0  504M   0% /dev/shm
tmpfs                    504M  492k  503M   1% /run
tmpfs                    504M     0  504M   0% /sys/fs/cgroup
/dev/mapper/fedora-root  5.5G  2.2G  3.4G  39% /
tmpfs                    504M  4.1k  504M   1% /tmp
/dev/mmcblk0p2           1.1G  100M  854M  11% /boot
/dev/mmcblk0p1           210M   21M  189M  11% /boot/efi
tmpfs                    101M     0  101M   0% /run/user/1000
[ludovic@localhost ~]$ fdisk -l
fdisk: cannot open /dev/mmcblk0: Permission denied
fdisk: cannot open /dev/mapper/fedora-root: Permission denied
fdisk: cannot open /dev/mapper/fedora-swap: Permission denied
[ludovic@localhost ~]$ sudo -i
[sudo] password for ludovic: 
[root@localhost ~]# fdisk -l
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 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
Disklabel type: dos
Disk identifier: 0x9235b19a

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *       2048   411647   409600  200M  6 FAT16
/dev/mmcblk0p2       411648  2508799  2097152    1G 83 Linux
/dev/mmcblk0p3      2508800 31116254 28607455 13.7G 8e Linux LVM


Disk /dev/mapper/fedora-root: 5.1 GiB, 5473566720 bytes, 10690560 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 /dev/mapper/fedora-swap: 720 MiB, 754974720 bytes, 1474560 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

Why is my lvm only 5gb and not more?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2018-10-20 08:35:51 -0500

lhirlimann gravatar image

OK thanks to Larsks on irc I was able to fix this. Not editing the wiki because the wiki also serves armv7 that doesn't use xfs.

so to get to where I have all my card used I did :

  1. sudo -i
  2. growpart /dev/mmcblk0 3
  3. pvresize /dev/mmcblk0p3
  4. vgdisplay - read the number of free PE
  5. lvextend -L +<number_of_free_extents> /dev/mapper/fedora-root
  6. is the number of free PE 0, if not goto 5
  7. xfs_growfs -d /
edit flag offensive delete link more
0

answered 2018-11-13 06:05:48 -0500

Ok this is my way to expand rootfs on a Fedora Server:

-------I am just setting up my Raspi 3b+ now. You are lucky------

[root@pi ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0         179:0    0 59.5G  0 disk
├─mmcblk0p1     179:1    0  200M  0 part /boot/efi
├─mmcblk0p2     179:2    0    1G  0 part /boot
└─mmcblk0p3     179:3    0  5.8G  0 part
  └─fedora-root 253:0    0  5.8G  0 lvm  /
zram0           252:0    0  453M  0 disk [SWAP]

that shows the rootfs did't take up the whole the sd-card

[root@pi ~]# growpart /dev/mmcblk0 3
CHANGED: partition=3 start=2508800 old: size=12171264 end=14680064 new: size=122226655,end=124735455
[root@pi ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0         179:0    0 59.5G  0 disk
├─mmcblk0p1     179:1    0  200M  0 part /boot/efi
├─mmcblk0p2     179:2    0    1G  0 part /boot
└─mmcblk0p3     179:3    0 58.3G  0 part
  └─fedora-root 253:0    0  5.8G  0 lvm  /
zram0           252:0    0  453M  0 disk [SWAP]
[root@pi ~]# partprobe

Then check PV

  [root@pi ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/mmcblk0p3
  VG Name               fedora
  PV Size               5.80 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1485
  Free PE               0
  Allocated PE          1485
  PV UUID               mrQIYi-AixY-ckDg-dvMF-eGTC-3u0o-Y4WJwC

Resize it:

[root@pi ~]# pvresize /dev/mmcblk0p3
  Physical volume "/dev/mmcblk0p3" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized
[root@pi ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/mmcblk0p3
  VG Name               fedora
  PV Size               58.28 GiB / not usable 3.98 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              14919
  Free PE               13434
  Allocated PE          1485
  PV UUID               mrQIYi-AixY-ckDg-dvMF-eGTC-3u0o-Y4WJwC

Check and resize LV

[root@pi ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/fedora/root
  LV Name                root
  VG Name                fedora
  LV UUID                O8wP2r-jTdL-ZUHF-NB0A-aujF-C4aN-Wxi1eO
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2018-10-25 07:51:39 +0800
  LV Status              available
  # open                 1
  LV Size                5.80 GiB
  Current LE             1485
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
[root@pi ~]# lvresize -l +100%FREE /dev/fedora/root
  Size of logical volume fedora/root changed from 5.80 GiB (1485 extents) to <58.28 GiB (14919 extents).
  Logical volume fedora/root successfully resized.

Finally resize filesystem.

[root@pi ~]# xfs_growfs /
meta-data=/dev/mapper/fedora-root isize=512    agcount=4, agsize=380160 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=1520640, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 1520640 to 15277056

If you are using EXT4, use resize2fs instead

edit flag offensive delete link more
0

answered 2018-10-18 20:48:20 -0500

You haven't allocated all your PEs (Physical Extents) from your VG (Volume Group) to your / (root) partition. Run the command "vgdisplay" to see your VG allocation. Look for the line "Free PE". If you have free PEs left (which you should), then use the command "lvextend -L +<number_of_free_extents> /dev/mapper/fedora-root" to extend your root container. Finally use either "resize2fs" (for EXT) or "xfs_growfs" (for XFS) command on your root partition to extend the actual filesystem.

edit flag offensive delete link more

Comments

So I just did a clean reinstall and this is what I get :

[root@localhost ~]# growpart /dev/mmcblk0 3
CHANGED: partition=3 start=2508800 old: size=12171264 end=14680064 new: size=28607455,end=31116255

[root@localhost ~]# vgdisplay
  --- Volume group ---
  VG Name               fedora
[snip]
  Total PE              1485
  Alloc PE / Size       1485 / 5.80 GiB
  Free  PE / Size       0 / 0   
  VG UUID               CtfkUX-w1WC-MdqS-3xRz-eDi8-L8x8-pNajPQ

I don't have free PE, any idea why?

lhirlimann gravatar imagelhirlimann ( 2018-10-20 08:04:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-10-16 10:40:19 -0500

Seen: 213 times

Last updated: Nov 13 '18