I have recently built a Raspberry Pi 3b+ with Kali Linux for the Pi (https://images.offensive-security.com/arm-images/kali-linux-2018.2-rpi3-nexmon.img.xz).
I have unpacked and dd the image onto my 32GB SanDisk microSD card. It has been configured for headless operation to connect to it with my cellphone for C&C through following this guide: https://null-byte.wonderhowto.com/how-to/set-up-headless-raspberry-pi-hacking-platform-running-kali-linux-0176182/
I can login to the Pi just fine, but as I started loading tools onto it through apt-get and Kali repositories, during the install of Metasploit (and dependencies) it error saying there was not enough space. Considering I access this through my phone, I am having to type the output I am seeing, so the format may be off, but the information is proper to the best of my ability. All commands are run as root.
First I did a
df -h which shows:
Filesystem Size Used Avail Use% Mounted On
/dev/root 6.7G 6.3G 31M 100% /
devtmpfs 460M 0 460M 0% /dev
tmpfs 464M 0 464M 0% /dev/shm
tmpfs 464M 13M 452M 3% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 464M 0 464M 0% /sys/fs/cgroup
/dev/mmcblk0p1 61M 22M 40M 36% /boot
tmpfs 93M 12K 93M 1% /run/user/0
tmpfs 93M 4.0K 93M 1% /run/user/109
I also did a
NAME MAJ:MIN RM SIZE RO TYPE MOUNT
mmcblk0 179:0 0 29.7G 0 disk
|-mmcblk0p1 179:1 0 61M 0 part /boot
|-mmcblk0p2 179:2 0 29.7G 0 part /
I also tried a manual resize of the partitions,
fdisk -l reports:
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 1 125000 125000 61M c W95 FAT32 (LBA)
/dev/mmcblk0p2 125001 62333951 62208951 29.7G 83 Linux
As suggested, I also tried
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 4
resize2fs: Permission denied to resize filesystem
I tried also installing both a 2015 and a 2016 copy of
raspi-config to use the expand file system part.
As you can see, the /dev/mmcblk0p2 does register as 32GB and mounted to / but the /dev/root which is also mounted to / only shows 6.7GB in size (which was the default after flashing Kali originally). I work in cyber but I do not do pen testing, nor am I a net/sys admin, so I am out of my element here. I just don't know what else I can do to fix this problem. I don't understand why / shows as 32GB in one place but only 7GB in another.
I don't mind wiping the card and starting over, but I would like to avoid it if possible. I also understand that the card may be physically damaged, had too many writes, or be partially "ghostlocked" as suggested by some forum posts. I would like to try a few more things before I accept the card as bad and having to replace it.