FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-18-2009, 03:21 AM
Jesse Keating
 
Default Mount existing filesystems read-only when getting size.

On Tue, 2009-03-17 at 17:06 -1000, David Cantrell wrote:
> Pass 'ro' in the mount options. Also add a hyphen in the temporary
> mount point name so it looks like 'getsize-XXXXXX'.
> ---
> storage/formats/fs.py | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/storage/formats/fs.py b/storage/formats/fs.py
> index ac2d9b5..a32c65b 100644
> --- a/storage/formats/fs.py
> +++ b/storage/formats/fs.py
> @@ -202,8 +202,8 @@ class FS(DeviceFormat):
> if self.mountable:
> origMountPoint = self._mountpoint
>
> - tmppath = tempfile.mkdtemp(prefix='getsize', dir='/tmp')
> - self.mount(mountpoint=tmppath)
> + tmppath = tempfile.mkdtemp(prefix='getsize-', dir='/tmp')
> + self.mount(mountpoint=tmppath, options="ro")
> buf = os.statvfs(tmppath)
> self.unmount()
>

Looks fine.

--
Jesse Keating
Fedora -- Freedom˛ is a feature!
identi.ca: http://identi.ca/jkeating
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org