Shrink root partition


I’ve just installed OSMC on my external hard drive. During installation my hard drive was formatted and all space was allocated to one ext4 partition. Is there a way to boot in rescue mode so I can safely shrink that partition and leave unallocated space for ntfs partition?
I tried shrink root partition during runtime with parted and ended up with input/output errors.

You are probably best using something like GParted for this.

But I recommend you avoid a USB install if you also want data on the drive, otherwise, if you ever need to reinstall, you could have problems.

You can’t shrink a partition while it’s mounted. You best bet would be to connect the drive to a system running linux (You could use a live CD, like Gparted Live CD).

If the drive is only going to be connected to the Pi, then why NTFS? EXT4 would be better. If you are planning on moving the drive back and forth between the Pi and Windows… Probably not the best idea, but it will work.

I want to keep media files on NTFS partition which will be shared for Windows with samba.
I kept osmc on SD card before but it broke so keeping OS on external drive will be more secure for me.

I will give it a try with gparted live cd. Thanks!

No need for the drive to be partitioned as NTFS to share files via Samba. The only reason you might do this is if you want to unplug the drive and directly connect it to a Windows PC.

But for sharing files via Samba to Windows machines ext4 is absolutely fine.