linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Avoiding disk changes
@ 2006-10-04 19:10 John Ward
  2006-10-05 10:36 ` Fabien Jakimowicz
  0 siblings, 1 reply; 4+ messages in thread
From: John Ward @ 2006-10-04 19:10 UTC (permalink / raw)
  To: linux-lvm

Question regarding disk changes for LVMs. Are there any known scenarios 
where the on disk information will change (automatically) after the 
device(s) are detected and probed by the system?

My scenario is, I want to plug my LVM drive(s) into a different machine 
(via external USB) for analysis. I want the drives to remain 100% 
unmodified.

I would like to setup my configuration such that no disk changes will 
occur.  Does anything within the LVM or DM realm modify the on-disk 
metadata under normal circumstances, or if a corrupted/broken LVM scheme 
is detected (partial or bad disk, etc.)?

In an attempt to gain absolute control over the detection and mounting 
process, I've set the global configuration file to test mode:

/etc/lvm/lvm.conf:
...
global {
...
	test = 1
...


After that, once I plug my device in, I set the LVM_SYSTEM_DIR env 
variable to point to my own configuration (because I don't want to 
twiddle with the system-wide one anymore than I have to).

I then use "vgchange --partial -a y" to access the new device, and 
create the /dev nodes.

In my custom lvm.conf (located in the $LVM_SYSTEM_DIR) I've set a few 
paranoid settings, including:

	filter = ... (only accept /dev/sd* devices)
	write_cache_state = 0
	backup = 0
	archive = 0
	locking_type = 0

	Setting test mode in this configuration wasn't allowing me to do the 
vgchange, so I left that off.

Hope this isn't too open ended of a question, short if diving into the 
source code, I've tried to research to what extent LVM might 
automatically twiddle bits on the drive.

Thanks in advance.

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

* Re: [linux-lvm] Avoiding disk changes
  2006-10-04 19:10 John Ward
@ 2006-10-05 10:36 ` Fabien Jakimowicz
  0 siblings, 0 replies; 4+ messages in thread
From: Fabien Jakimowicz @ 2006-10-05 10:36 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]

On Wed, 2006-10-04 at 15:10 -0400, John Ward wrote:
> Question regarding disk changes for LVMs. Are there any known scenarios 
> where the on disk information will change (automatically) after the 
> device(s) are detected and probed by the system?
> 
> My scenario is, I want to plug my LVM drive(s) into a different machine 
> (via external USB) for analysis. I want the drives to remain 100% 
> unmodified.
> 
> I would like to setup my configuration such that no disk changes will 
> occur.  Does anything within the LVM or DM realm modify the on-disk 
> metadata under normal circumstances, or if a corrupted/broken LVM scheme 
> is detected (partial or bad disk, etc.)?
> 
> In an attempt to gain absolute control over the detection and mounting 
> process, I've set the global configuration file to test mode:
> 
> /etc/lvm/lvm.conf:
> ...
> global {
> ...
> 	test = 1
> ...
> 
> 
> After that, once I plug my device in, I set the LVM_SYSTEM_DIR env 
> variable to point to my own configuration (because I don't want to 
> twiddle with the system-wide one anymore than I have to).
> 
> I then use "vgchange --partial -a y" to access the new device, and 
> create the /dev nodes.
> 
> In my custom lvm.conf (located in the $LVM_SYSTEM_DIR) I've set a few 
> paranoid settings, including:
> 
> 	filter = ... (only accept /dev/sd* devices)
> 	write_cache_state = 0
> 	backup = 0
> 	archive = 0
> 	locking_type = 0
> 
> 	Setting test mode in this configuration wasn't allowing me to do the 
> vgchange, so I left that off.
> 
> Hope this isn't too open ended of a question, short if diving into the 
> source code, I've tried to research to what extent LVM might 
> automatically twiddle bits on the drive.
> 
> Thanks in advance.

Try to use hdparm to set your hard-drive in read-only mode.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [linux-lvm] Avoiding disk changes
@ 2006-10-05 13:22 John Ward
  2006-10-05 17:22 ` David Brown
  0 siblings, 1 reply; 4+ messages in thread
From: John Ward @ 2006-10-05 13:22 UTC (permalink / raw)
  To: linux-lvm

> Try to use hdparm to set your hard-drive in read-only mode.

Interesting suggestion, certainly shouldn't hurt.  But AFAIK the device 
mapper runs in the kernel and it's going to do it's "own thing" before I 
get a chance to hdparm it.

That's why I'm most interested in determining what (if anything) a LVM 
configuration does ... especially in situations where it detects a 
bad/repairable configuration (if that even makes sense).

Regardless, I'll do some experimenting - not sure if there are going to 
be any limitations with hdparm and configuring my disks via a USB adapter.

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

* Re: [linux-lvm] Avoiding disk changes
  2006-10-05 13:22 [linux-lvm] Avoiding disk changes John Ward
@ 2006-10-05 17:22 ` David Brown
  0 siblings, 0 replies; 4+ messages in thread
From: David Brown @ 2006-10-05 17:22 UTC (permalink / raw)
  To: LVM general discussion and development

John Ward wrote:

>> Try to use hdparm to set your hard-drive in read-only mode.

> Interesting suggestion, certainly shouldn't hurt.  But AFAIK the device
> mapper runs in the kernel and it's going to do it's "own thing" before I
> get a chance to hdparm it.

The device mapper runs in the kernel, but it has no knowledge of the lvm
structures.  This is all done at user level.

I've forgotten in the thread whether or not this is a removable device.  If
it is, you can plug it in after startup, hdparm if that makes you more
comfortable, and then rescan for physical volumes.  If it is a more
permanently attached volume, you might have to modify the OS's startup
scripts to achieve this.

Perhaps you should use a CD-bootable rescue system (I recommend RIP Linux).
At least RIP boots up, and you have to start LVM manually, which would give
you a chance run hdparm and make it read only.

Dave Brown

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

end of thread, other threads:[~2006-10-05 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 13:22 [linux-lvm] Avoiding disk changes John Ward
2006-10-05 17:22 ` David Brown
  -- strict thread matches above, loose matches on Subject: below --
2006-10-04 19:10 John Ward
2006-10-05 10:36 ` Fabien Jakimowicz

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).