Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a beaglebone black that i've installed debian wheezy from http://www.armhf.com onto the eMMC

While this was working great up until recently when I ran out of inodes on the patition even though I had 40% of space free on the device. Now I understand I cant increase inodes on a filesystem that has unix installed and I need to recreate the patition which I am happy to do after having backed up my work. Only issue is how do I go about doing this?

This is what I have tried so far

Create a microSD with bootable debian,

boot into debian on the USB then format the emmc

mkfs.ext4 -i 4096 /dev/mmcblk1

my understanding is that using the -i argument I can specify for every 4096 bytes a inode should be created I have tried this twice now, once with 4096 a second time with 2048

get the debian image

wget http://s3.armhf.com/debian/wheezy/bone/debian-wheezy-7.2-armhf-3.8.13-bone30.img.xz

extract it to the new partition

xz -cd debian-wheezy-7.2-armhf-3.8.13-bone30.img.xz > /dev/mmcblk1

Which to me seems like the correct steps although each time I do this when I type df -i the result is always the same amount of inodes (11,7000~) or something like that Would really appreciate some guidance on how I can achieve increasing the inodes above the default.

Cheers Tim

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

The problem is that when you run xz -cd ... > /dev/mmcblk1, you're overwriting the filesystem you created earlier. The image you downloaded is a full disk image, which contains a pre-formatted filesystem.

If you want to use that prebuilt image, your only solution is going to be to copy the data off the partition, reformat it, and copy the data back.

Let's say that after running your xz -cd ... > /dev/mmcblk1 command, you now have the partition /dev/mmcblk1p1 which contains your filesystem.
If the guide you're following doesn't have you do it, you may need to rescan the partition table to pick up the new partitions. This is done with partprobe /dev/mmcblk1

# Get the current UUID & filesystem label
eval "$(blkid -o export /dev/mmcblk1p1)"
# This just created 2 variables called $LABEL and $UUID

# Mount the partition somewhere  
mount /dev/mmcblk1p1 /mnt/bone

# Copy the contents off
tar --numeric-owner -czpSf /tmp/bone.tar.gz -C /mnt/bone .

# Unmount the partition
umount /mnt/bone

# Format the partition
mkfs.ext4 -i 4096 -U "$UUID" -L "$LABEL" /dev/mmcblk1p1

# Mount the partition back up
mount /dev/mmcblk1p1 /mnt/bone

# Copy the contents back
tar -C /mnt/bone --numeric-owner -xzpf /tmp/bone.tar.gz

# Unmount again
umount /mnt/bone

At this point you should have a fully rebuilt ext4 filesystem with a customized number of inodes.

share|improve this answer
    
Thanks Patrick, I'll give this a try and hopefully it resolves my issue, thanks for your time. –  Tim Kalinowski May 5 at 2:44
    
champion, this worked perfect and I learnt something new. beaglebone has two partitions, one for boot in fat32 and the other linux partition so only amendment for anyone else who comes across this partition is mmcblk1p2 instead of mmcblk1p1 :) –  Tim Kalinowski May 5 at 4:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.