473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Re: Getting Linux partition info programmatically

python dev wrote:
Hello everyone,

I am trying to get a list of all the partitions (along with their respective
file system types) listed in the /media directory. Does anybody know if
there is a way to do this using Python, or do I have to get this information
by parsing the output of a Linux command?
The /sys and /proc file system provide all the information you need:

for line in open("/proc/mounts"):
...

Christian

Sep 12 '08 #1
0 1307

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: cantabile | last post by:
Hi, I'd like to get drives and partitions (and their size too) with python under Linux. So far, I thought of reading /proc/partitions but maybe i could use fdsik also ? How would I do that in...
0
by: Rvk | last post by:
I am hosting an intranet on a machine with dual boot in both win98 and RH9 Linux. the intranet was first set up and running in win98. I have a mysql database in the win98 . The win98 partition is...
6
by: Bill Mill | last post by:
On my laptop, I have an NTFS partition for NT, a FAT partition for data as a dmz which both linux and NT can access, and an ext3 partition for linux. However, I've experienced some weirdness on the...
1
by: news | last post by:
OP wrote: }in order to justify learning another language I'd first need to be }convinced that python could easily do the following:- } }ReadSectors2Bufr(hdx, StartSectr, SectrCnt, Bufr); <-- like...
11
by: Amadrias | last post by:
Hi, In one of my current projects, I am willing to create a secure zone such as Acronis does in its application to store some confidential information only accessible to the current machine...
5
by: sameer_deshpande | last post by:
Hi, I need to create a partition table but the column on which I need to create a partition may not have any logical ranges. So while creating or defining partition function I can not use any...
1
Plater
by: Plater | last post by:
I've run into a bit of trouble on this, not sure anyone here has ever done anything similar. We have a cirus ARM chip with an MTD FLASH chip Redboot is running on it (with ethernet support)...
1
Nepomuk
by: Nepomuk | last post by:
In most modern distributions of Linux and Unix (at least ones with graphical environments like KDE, Gnome or XFCE), you get to mount your partitions easily from the desktop. In some cases however, it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.