-
Notifications
You must be signed in to change notification settings - Fork 0
Partitioning
JayBeeDe edited this page Jan 6, 2024
·
1 revision
If not using LVM, it is also possible to extend over a RAID 0:
df -h; blkid
mkfs.ext2; mkfs.ext3; mkfs.ext4; mkfs.fat; mkfs.vfat; mkfs.msdos; mkfs.ntfs; mkfs.xfs
lvdisplay; lvs; blkid
lvcreate
lvresize
lvremove
lvextend; lvreduce
vgdisplay; vgs
vgcreate
vgremove
vgextend; vgreduce
pvdisplay; pvs
pvcreate
pvresize
pvremove
mdadm –detail
mdadm –create
mdadm --add /dev/md2 /dev/sdh1
#add hot spare
fdisk
gdisk
pvcreate /dev/sdf[3,4]
Physical volume "/dev/sdf3" successfully created
Physical volume "/dev/sdf4" successfully created
#create a physical volume
mdadm --create /dev/md6 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
#create a soft raid1
vgcreate datavg /dev/sdf[3,4]
Volume group "datavg" successfully created
#create a volume group
lvcreate -n vol_projects -L 10G datavg
lvcreate -n vol_backups -l 100%FREE datavg
#note that --type linear is implicit here
#--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
lvreduce -L -2.5G -r /dev/vg00/vol_projects
lvextend -l +100%FREE -r /dev/vg00/vol_backups
#re-adjust logical volumes sizes
vgextend vg00 /dev/sdd
#add /dev/sdd to vg00 (LVM extension)
lvcreate -L 50M -m1 -n mirrorlv datavg
Rounding up size to full physical extent 52.00 MB
Logical volume "mirrorlv" created
#create a logical volume (but with mirroring)
#note that --type mirror is implicit here
mkfs:ext4 /dev/datavg/mirrorlv
#create file system
If you find any mistake, do not hesitate to open an issue.