NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problem with gpt partitioning in NetBSD-5.0.2 amd64



Unfortunately I don't think it helped:

server1# gcc -o zap_gpt zap_gpt.c 
server1# ./zap_gpt                
zap_gpt: write: Invalid argument
server1# gpt -v destroy sd0       
gpt: rsd0d: mediasize=4499999293440; sectorsize=512; blocks=8789061120
gpt: unable to open device 'rsd0d': Invalid argument

/Peter

On 04/01/2010 11:59 PM, Christos Zoulas wrote:
> #include <stdlib.h>
> #include <unistd.h>
> #include <fcntl.h>
> #include <err.h>
>
> int
> main(void)
> {
>         static char buf[0x200];
>         int fd = open("/dev/rsd0d", O_RDWR);
>
>       if (fd == -1)
>               err(1, "open");
>         if (lseek(fd, 0x7f7ffd616400ULL, SEEK_SET) == (off_t)-1)
>               err(1, "lseek");
>         if (write(fd, buf, sizeof(buf)) == -1)
>               err(1, "write");
>         (void)close(fd);
>         return 0;
> }
>   


Home | Main Index | Thread Index | Old Index