why i can't read sda1 with python?

水静流深 1248283536 at qq.com
Fri Jun 1 22:14:36 EDT 2012


tiger at debian:~$ sudo  fdisk  -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x073a3c87

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1912    15358108+   c  W95 FAT32 (LBA)
/dev/sda2            1913        3736    14647296    b  W95 FAT32
/dev/sda3            3736        3979     1952768   83  Linux
/dev/sda4            3979       14594    85260289    5  Extended
/dev/sda5            3979        4040      487424   83  Linux
/dev/sda6            4040        4769     5858304   83  Linux
/dev/sda7            4770        4891      975872   83  Linux
/dev/sda8            4891        5134     1951744   83  Linux
/dev/sda9            5134       14374    74217472   83  Linux
/dev/sda10          14374       14594     1764352   82  Linux swap / Solaris

i want to read  sda1  with python:
>>> file=open('/dev/sda1','rb')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 13] Permission denied: '/dev/sda1'

how can i own the access to read sda1?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120602/a4c5bb79/attachment.html>


More information about the Python-list mailing list