but the retailer told me that installing linux or partitioning the hard disk will make the warranty void
I don't know about the legality of it, but it would not surprise me. Support does not generate revenue and companies will take any opportunity to minimize their losses. Have a look around the Linux on Laptops pages and forums. Maybe someone there has some experience with HP and their warranty policy in particular. If you are just experimenting with Linux, consider using VMWare to run it within Windows or use a CD-bootable distribution like Knoppix. I've used it on my Fujitsu laptop and it works great.