linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to access contents of directory underneath mounted volume?
@ 2008-08-26  1:32 Guy Waugh
  2008-08-26  2:58 ` Glynn Clements
  0 siblings, 1 reply; 3+ messages in thread
From: Guy Waugh @ 2008-08-26  1:32 UTC (permalink / raw)
  To: linux-admin

Hello,

On a RHEL4 host, I have a mountpoint, /thing, with a SAN volume mounted 
at this mountpoint.

The local volume that contains the mountpoint (i.e. the volume that is 
mounted at /) is nearly full, and I'm suspecting it is because there are 
files on the local volume in the /thing directory. Of course, I can't 
get to the /thing directory by normal means (at least AFAIK), because 
there is currently a volume mounted at that mountpoint.

Does anyone know if it possible to access (i.e. see and delete) the 
files in the /thing directory without having to umount the SAN volume 
that is mounted at /thing?

Thanks,
Guy.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to access contents of directory underneath mounted volume?
  2008-08-26  1:32 How to access contents of directory underneath mounted volume? Guy Waugh
@ 2008-08-26  2:58 ` Glynn Clements
  2008-08-27  0:10   ` Guy Waugh
  0 siblings, 1 reply; 3+ messages in thread
From: Glynn Clements @ 2008-08-26  2:58 UTC (permalink / raw)
  To: linux-admin


Guy Waugh wrote:

> On a RHEL4 host, I have a mountpoint, /thing, with a SAN volume mounted 
> at this mountpoint.
> 
> The local volume that contains the mountpoint (i.e. the volume that is 
> mounted at /) is nearly full, and I'm suspecting it is because there are 
> files on the local volume in the /thing directory. Of course, I can't 
> get to the /thing directory by normal means (at least AFAIK), because 
> there is currently a volume mounted at that mountpoint.
> 
> Does anyone know if it possible to access (i.e. see and delete) the 
> files in the /thing directory without having to umount the SAN volume 
> that is mounted at /thing?

If some existing process has its CWD underneath /thing, then you can
access that directory via /proc/<pid>/cwd.

You could use debugfs on the root fs, but I wouldn't recommend trying
to modify a filesystem while it's mounted r/w.

If you can't unmount the SAN because it's busy, you may still be able
to move its mount point with "mount --move". If you can allow for it
being unavailable briefly you could move it off just long enough to
rename the underlying directory, e.g.:

	mkdir /thing.tmp
	mount --move /thing /thing.tmp
	mv /thing /thing.orig
	mkdir /thing
	mount --move /thing.tmp /thing
	rmdir /thing.tmp

-- 
Glynn Clements <glynn@gclements.plus.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to access contents of directory underneath mounted volume?
  2008-08-26  2:58 ` Glynn Clements
@ 2008-08-27  0:10   ` Guy Waugh
  0 siblings, 0 replies; 3+ messages in thread
From: Guy Waugh @ 2008-08-27  0:10 UTC (permalink / raw)
  To: linux-admin

Glynn Clements wrote:
> Guy Waugh wrote:
> 
>> On a RHEL4 host, I have a mountpoint, /thing, with a SAN volume mounted 
>> at this mountpoint.
>>
>> The local volume that contains the mountpoint (i.e. the volume that is 
>> mounted at /) is nearly full, and I'm suspecting it is because there are 
>> files on the local volume in the /thing directory. Of course, I can't 
>> get to the /thing directory by normal means (at least AFAIK), because 
>> there is currently a volume mounted at that mountpoint.
>>
>> Does anyone know if it possible to access (i.e. see and delete) the 
>> files in the /thing directory without having to umount the SAN volume 
>> that is mounted at /thing?
> 
> If some existing process has its CWD underneath /thing, then you can
> access that directory via /proc/<pid>/cwd.
> 
> You could use debugfs on the root fs, but I wouldn't recommend trying
> to modify a filesystem while it's mounted r/w.
> 
> If you can't unmount the SAN because it's busy, you may still be able
> to move its mount point with "mount --move". If you can allow for it
> being unavailable briefly you could move it off just long enough to
> rename the underlying directory, e.g.:
> 
> 	mkdir /thing.tmp
> 	mount --move /thing /thing.tmp
> 	mv /thing /thing.orig
> 	mkdir /thing
> 	mount --move /thing.tmp /thing
> 	rmdir /thing.tmp

Thanks Glynn, the last suggestion using "mount --move" looks like the 
most useful. However, it's sounding like it's going to be easiest for me 
to schedule some downtime.

Cheers,
Guy.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-27  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-26  1:32 How to access contents of directory underneath mounted volume? Guy Waugh
2008-08-26  2:58 ` Glynn Clements
2008-08-27  0:10   ` Guy Waugh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).