Skip to content

Partitioning

JayBeeDe edited this page Jan 6, 2024 · 1 revision

Overview

Overview

If not using LVM, it is also possible to extend over a RAID 0:

Overview

ZFS

Useful commands

File Systems commands

df -h; blkid
mkfs.ext2; mkfs.ext3; mkfs.ext4; mkfs.fat; mkfs.vfat; mkfs.msdos; mkfs.ntfs; mkfs.xfs

Logical Volumes commands

lvdisplay; lvs; blkid
lvcreate
lvresize
lvremove
lvextend; lvreduce

Volume Groups commands

vgdisplay; vgs
vgcreate
vgremove
vgextend; vgreduce

Physical Volumes commands

pvdisplay; pvs
pvcreate
pvresize
pvremove

SW RAID Disks commands

mdadm –detail
mdadm –create
mdadm --add /dev/md2 /dev/sdh1
#add hot spare

Physical Partitions commands

fdisk
gdisk

Other Commands

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
Clone this wiki locally