tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: LVM and 4K sectors



On Jan 3,  8:59pm, Benny Siegert wrote:
}
} I am trying to set up LVM on a 4T hard drive that has 4096-byte
} sectors. However:
} 
} # gpt create sd0
} # gpt add  sd0
} /dev/rsd0: Partition 1 added: 49f48d5a-b10e-11dc-b99b-0019d1879648 6 976754635
} # newfs /dev/rdk4
} /dev/rdk4: 3815447.8MB (976754635 sectors) block size 32768, fragment size 4096
}         using 5148 cylinder groups of 741.25MB, 23720 blks, 47104 inodes.
} super-block backups (for fsck_ffs -b #) at:
} 8, 189768, 379528, 569288, 759048, 948808, 1138568, 1328328, 1518088,
} 1707848, 1897608,
} ^C
} #
} # gpt type -i 1 -T linux-lvm sd0
} /dev/rsd0: Partition 1 type changed
} # lvm pvcreate -v -Z y /dev/rdk4
}     Set up physical volume for "/dev/rdk4" with 976754635 available sectors
}     Zeroing start of device /dev/rdk4
}   Physical volume "/dev/rdk4" successfully created
} # lvm pvs
}   PV         VG   Fmt  Attr PSize   PFree
}   /dev/rdk4       lvm2 --   465.75g 465.75g
}   /dev/rsd1a vg0  lvm2 a-   931.51g 100.20g
} 
} The number of sectors is correct but it assumes that they are 512 bytes.
} 
} # lvm pvremove /dev/rdk4
}   Labels on physical volume "/dev/rdk4" successfully wiped
} # lvm pvcreate -v -Z y --setphysicalvolumesize 3726g /dev/rdk4
}   WARNING: /dev/rdk4: Overriding real size. You could lose data.
}     /dev/rdk4: Pretending size is 7813988352 sectors.
}     Set up physical volume for "/dev/rdk4" with 7813988352 available sectors
}     Zeroing start of device /dev/rdk4
}   Physical volume "/dev/rdk4" successfully created
} # lvm pvs
}   PV         VG   Fmt  Attr PSize   PFree
}   /dev/rdk4       lvm2 --     3.64t   3.64t
}   /dev/rsd1a vg0  lvm2 a-   931.51g 100.20g
} 
} How safe will my data be on this? Is it a terrible idea to mix two
} disks in a VG if one of them has 512-byte sectors and one 4K sectors?

     Unfortunately, the LVM tools are quite old so you do need to
override the size for large disks.  I have done this a number of
times with no ill effect despite the warning.

     I don't see a real problem with this besides performance as
the drive or driver might have to an RMW cycle if less then 4K of
data is written.

}-- End of excerpt from Benny Siegert


Home | Main Index | Thread Index | Old Index