On Wed, Dec 23, 2020 at 07:19:36AM +0000, mick crane wrote: > On 2020-12-23 03:37, Andy Smith wrote: > <..> > >e.g. if you install a drive and it shows up in your OS as /dev/foo > >of size 1TB, then: > > > ># pvcreate /dev/foo > ># vgcreate myvg /dev/foo > > > >Now you have a volume group called "myvg" with ~1TB (some space > >reserved for metadata) available for allocation. > > This might be where I have gotten confused as online tutorial > indicates to fdisk the disk first in partitions. > Make physical volumes of the partitions then create a volume group > of the partitions. > You are saying that there is no need to use fdisk to make partitions ?
Not the OP, but basically, that's true. > Can make Volume Group of raw device eg /dev/sdc after first saying > it is a Physical Volume ? Yes. There are several layers at work here. The lowest (for our current purposes) is the "block device", which is just an array of equally sized blocks. This can be a whole "disk" (whatever that [1] may be) e.g. /dev/sdc. Sometimes you divvy up that disk into partitions, then you have /dev/sdc2 as a block device. Sometimes you layer a LUKS device on that, to make sure the stuff ends up encrypted, to protect your data at rest. The LUKS subsystem sees that the decrypted data appears as a block device somewhere (for my laptop one of them is is /dev/dm-4, with a more readable symlink /dev/mapper/trotzki-home pointing to it). Sometimes you want to bundle a bunch of block devices to make one (bigger, more failsafe, perhaps faster, whatever) group of things. You can stack several of those things. For example, on my laptop, there's a encrypted container (with LUKS), on top of which I divvy that up with LVM (I like having separate partitions for things, but I also like to shift around storage between them should I have painted myself into a corner. LVM helps with that). A regular file in your file system can be "made" into a block device with the help of a "loopback device". On top of that tower, you make a file system (what you call "format", which is an unfortunate term here, because it's too broad. As other things we inherited from DOS). The commands to make filesystems (e.g. mkfs.ext4 for an Ext 4 file system) all take one of those block devices as obtained above. It is the last step in the tower. Cheers [1] Disk is a metaphor. Sometimes, there's actually spinning rust inside; sometimes something else. - t
signature.asc
Description: Digital signature