English
Ask Your Question
0

Lost SD card space on rpi2 fedora 27 server

asked 2017-12-03 02:28:59 +0000

updated 2017-12-03 10:26:46 +0000

I installed fedora 27 server in a raspberry pi 2 on a 16gb sd card through the following command:

$ sudo arm-image-installer --image=./Fedora-Server-armhfp-27-1.6-sda.raw.xz --target=rpi2 --norootpass --resizefs --media=/dev/mmcblk0 -y --addkey=./path/to/key.pub
=====================================================
= Selected Image:                                 
= ./Fedora-Server-armhfp-27-1.6-sda.raw.xz
= Selected Media : /dev/mmcblk0
= U-Boot Target : rpi2
= Root Password will be removed.
= Root partition will be resized
= SSH Public Key /path/to/key.pub will be added.
= Writing: 
= ./Fedora-Server-armhfp-27-1.6-sda.raw.xz 
= To: /dev/mmcblk0 ....
0+306692 records in
0+306692 records out
3726639104 bytes (3.7 GB, 3.5 GiB) copied, 328.471 s, 11.3 MB/s
= Writing image complete!
= Resizing /dev/mmcblk0 ....
Checking that no-one is using this disk right now ... OK

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: 0x926847c3

Old situation:

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk0p1         2048   61439   59392   29M  c W95 FAT32 (LBA)
/dev/mmcblk0p2 *      61440 1060863  999424  488M 83 Linux
/dev/mmcblk0p3      1060864 2060287  999424  488M 82 Linux swap / Solaris
/dev/mmcblk0p4      2060288 6942719 4882432  2.3G 82 Linux swap / Solaris

/dev/mmcblk0p4: 
New situation:
Disklabel type: dos
Disk identifier: 0x926847c3

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1         2048    61439    59392   29M  c W95 FAT32 (LBA)
/dev/mmcblk0p2 *      61440  1060863   999424  488M 83 Linux
/dev/mmcblk0p3      1060864  2060287   999424  488M 82 Linux swap / Solaris
/dev/mmcblk0p4      2060288 31116287 29056000 13.9G 82 Linux swap / Solaris

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
/sbin/fsck.xfs: XFS file system.
xfs_growfs: /dev/mmcblk0p4 is not a mounted XFS filesystem
= Removing the root password.
= Adding SSH key to authorized keys.
= No U-Boot will be installed.

= Installation Complete! Insert into the rpi2 and boot.

I am not sure if the line xfs_growfs: /dev/mmcblk0p4 is not a mounted XFS filesystem is indicative of a problem.

I then logged remotely (the rpi2 runs headless) in at the rpi2 and all I 've done is dnf upgrade and reboot. I then checked for the available disk space and got the following results:

[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        446M     0  446M   0% /dev
tmpfs           488M     0  488M   0% /dev/shm
tmpfs           488M  412K  487M   1% /run
tmpfs           488M     0  488M   0% /sys/fs/cgroup
/dev/mmcblk0p4  2.4G  1.8G  587M  76% /
/dev/mmcblk0p2  457M  244M  199M  56% /boot
tmpfs            98M     0   98M   0% /run/user/0

This looked strange. It's as if the root filesystem has not been resized but I explicitly gave the command to resize it! I went ahead and looked for partition layout through other commands:

[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 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-12-06 00:15:37 +0000

The problem actually came from

xfs_growfs: /dev/mmcblk0p4 is not a mounted XFS filesystem

It appears this is a bug in fedora-arm-installer package that has been fixed upstream but has not made it in the repositories yet. The problem was that the device location instead of the mount point was given as an argument to the xfs_growfs command. If you are currently experiencing it the solution is to run:

$ xfs_growfs -d /
meta-data=/dev/mmcblk0p4         isize=512    agcount=4, agsize=152576 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1 spinodes=0 rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=610304, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               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 610304 to 3632000
edit flag offensive delete link more

Your Answer

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

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2017-12-03 02:28:59 +0000

Seen: 50 times

Last updated: Dec 06