Have a look at mount | grep mmcblk0p2
, e.g., from a typical (non-NOOBS) pi:
/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
/dev/mmcblk0p1 on /boot/rpi type vfat (rw,relatime,...)
Anything that's actually mounted you should probably keep; the other partitions you can do what you want with. You can get a list with ls -1 /dev | grep mmcblk0p
. Anything in the second list not in the first list is not in use. Note the first line above, with on /
. That partition is your root filesystem.
Now, back up /boot/cmdline.txt
in case what I am recommending here doesn't work, I do not have a NOOBS card to try it on.1 Edit cmdline.txt
and find root=/dev/mmcblk0p??
and change whatever ??
is to whatever your root filesystem partition is (in the example above, 2
). It might be so already.
If everything now boots okay, you can reformat stuff in those unused partitions. You can get the sizes with sudo fdisk /dev/mmcblk0
, then p
to see the partition table. You can also delete and replace adjacent partitions to make a larger partition with fdisk, but that is another question (I'm sure you'll find stuff online about this).
When you have a partition you want to use, sudo mkfs.ext4 /dev/mmcblk0p??
where ??
is the number. Remember, do not do this to something that was shown in mount
.
If you want to transfer, e.g., your home directories there, make sure the users are logged out (i.e., log in as root
), then:
mkdir /mnt/extra
mount /dev/mmcblk0p?? /mount/extra
There should be no errors. Check in /mnt/extra
. It should contain one directory, /lost+found
. Then:
cp -a /home/* /mnt/extra
/home
and /mnt/extra
should now be identical. There should not be a /mnt/extra/home
-- that means you left the /*
off.
When you are sure this is all good, you can delete everything in /home
, but keep it as a directory: rm -rf /home/*
. This will free that space up in your root partition.
Add a line to /etc/fstab
:
/dev/mmcblk0p?? /home ext4 defaults,noatime 0 3
This will mount that new partition on /home
at boot so everything is normal. You can try that now:
umount /mnt/extra
mount /dev/mmcblk0p?? /home
Remember, don't really use ??
anywhere. You should be able to log in as pi
or whoever and find your normal home directory.
1. In fact, I strongly recommend you back the whole card up before you try this, just in case.