Warren Buffett’s Berkshire Hathaway Inc. is nearing a deal to buy Precision Castparts Corp., according to people familiar with the matter, in what could be the conglomerate’s largest takeover ever.

Given typical premiums, the price tag for the industrial company, which had a market value of $26.7 billion as of Friday’s close, could exceed $30 billion. At that size, the deal would rank as Berkshire’s largest ever and represent the latest megamerger in a robust year for deal making.