Both Shanks and Buggy were apprentices on Gol D. Roger's ships. I had this doubt that whether they know the location of One Piece, shouldn't they know considering they were on the ship?
As stated on the wiki
Aside from the Roger Pirates and Whitebeard, before their death, no one actually knows where the great treasure is. source
This would mean both Shanks and Buggy would know the location of the One Piece. According to the information the most likely also know what the one piece is Sort of a spoiler
Given the recurring theme of treasure being something of great personal value (for example Luffy's hat), One Piece may simply be an item that Gol D. Roger valued. In Buggy's flashback to his days as a member of the Roger Pirates, he discussed with Shanks the meaning of a treasure, and he found that all the crew shared the same views regarding personal value Vol. 3 Chapter 19 (p. 8)
As to the location they described
It is said that it was hidden somewhere deep in the Grand Line, presumably in the last island, Raftel, by its deceased owner, the Pirate King Gol D. Roger
we don't know what exactly is one piece. odachi said it is some tangible thing. gol d roger is the only other person to use voice of all thins aside from luffy. although it hasn't been shown till now, maybe to reach and find one piece, the ability to hear voice of all things is required. shanks and buggy don't have this ability so they don't know what and where is one piece and are searching in new world.
Only Gol D. Roger and Rayleigh are the ones who know about the One Piece. Do you remember the scene when Roger had a chit chat with Whitebeard? He offered to give information about One Piece to Whitebeard, but he rejected it, because he doesn't want the One Piece. Also, when Usopp asked Rayleigh about the location of One Piece, he said he knew.
I know that Shanks and Buggy can't use the Voice of All Things but they were rookies on Gol. D Roger's ship which means that they travelled around with him, possibly even to Raftel and they could have found the One Piece together. But that begs the questions of "did Gol. D Roger go to Raftel and find the One Piece before Shanks and Buggy joined their crew?" which means that if Whitebeard doesn't want to title of King of Pirates, then everyone is basically helping Luffy obtain it with the help of Rayleigh and Whitebeard since they know about Raftel and One Piece...