Mac Mini OSX Yosemite Boot up problem.
So. I recently got a Mac mini late 2012 refurbished. I have had it for a number of weeks and no problems. It is running osx Yosemite and has been working fine until today. When I went to turn on my mac it was loading abnormally slow. I shrugged it off but when I came back a number of minutes later it had turned itself off.i tried to boot it up multiple times but it always gets stuck at about 50% and then closes itself down. Ive tried multiple ways of getting it to work. E.g resetting the NVRAM and the SMC. Running in safe mode which is impossible because I have a usb keyboard and when I press the shift key it doesn't get through quick enough. however I think I know what the problem is. I went into disk utility in recovery mode and tried to repair untitled which is my startup disk but unfortunately it says that it is corrupt and doesn't work and that I should back up as much files as I can etc. Please help I'm really scared that it is broken and I need help. Thank you.
Mac mini, OS X Yosemite (10.10.4), null