Seagate buys Samsung’s hard drive business as sales shrink