Goline It Services Logo

News

  • GOLINE SA is excited to announce a new partnership with NetApp, a global leader in cloud data services and storage solutions. This collaboration aims to help organizations modernize their IT infrastructure, streamline data management, and enhance performance across cloud and hybrid environments. Modern Data Solutions for Businesses Through this partnership, GOLINE integrates advanced data management solutions, enabling businesses to securely store, manage, and access critical information across cloud, on-premises, or hybrid setups. Clients can benefit from: Flexible and scalable storage solutions to meet growing data needs Simplified management of cloud and on-premises environments Enterprise-grade security for sensitive and mission-critical data...
  • GOLINE SA is proud to announce a new strategic partnership with Omnissa, a global leader in digital workspace platforms and Horizon Cloud Service solutions. This collaboration marks a significant step forward in helping organizations embrace secure, flexible, and high-performance work environments. Why Choose Omnissa for Your Business? The platform enables virtual desktops, applications, and unified endpoint management. Organizations can deploy scalable workspaces across cloud, hybrid, or on-premises setups. Key benefits include: Easy access to desktops and apps on any device Centralized management for Windows, macOS, iOS, Android, and ChromeOS Strong security with access controls and multi-factor authentication Automated scaling to...
  • Goline is proud to announce a strategic partnership with Cloudflare, the world leader in web performance and security solutions. This collaboration aims to provide goline.ch customers with state-of-the-art protection against cyber threats while delivering lightning-fast website performance. Through this partnership, Goline integrates Cloudflare’s advanced services, including DDoS protection, CDN caching, DNS security, and edge computing, allowing businesses to secure and optimize their websites effortlessly. Users will benefit from improved page load speed, enhanced reliability, and robust defense against malicious attacks. This partnership with Cloudflare enables goline to offer unmatched security and performance solutions to clients. By leveraging Cloudflare’s cutting-edge technology,...

Linux LVM Disk

Miro Manglaviti Linux 22 June 2022
Fonti
 
Esempio, creazione di un Logical Volume in Volume Group con tre partizioni ed Estensione del VG. 
 

Visualizzare i dischi fisici e le partizioni
fdisk -l
lsblk
pvscan (mostra spazio libero)

Nuovo disco:
/dev/sdb

Creare 3 partizioni sul disco /dev/sdb da 100M
fdisk /dev/sdb
n
p
1
(primo settore default)
ultimo: +100M
 
fdisk /dev/sdb
n
p
2
(primo settore default)
ultimo: +100M
 
fdisk /dev/sdb
n
p
3
(primo settore default)
ultimo: +100M
 
Visualizzare le partizioni create:
p
Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      206847      102400   83  Linux
/dev/sdb2          206848      411647      102400   83  Linux
/dev/sdb3          411648      616447      102400   83  Linux
 
 
eventualmente t per cambiare tipo di partizione in LSV
8e = changes to LVM partition type
ma non sembra necessario
 
w per salvare
 
———————–
 
Update the kernel to save the changes without restarting the system.
partprobe
 
 
Creare i volumi fisici 
 
[root@localhost boot]# pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3
  Physical volume “/dev/sdb1” successfully created
  Physical volume “/dev/sdb2” successfully created
  Physical volume “/dev/sdb3” successfully created
 
Visualizza i volumi fisici: 
 
[root@localhost boot]# pvdisplay 
  — Physical volume —
  PV Name               /dev/sda2
  VG Name               centos
  PV Size               19.51 GiB / not usable 3.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              4994
  Free PE               10
  Allocated PE          4984
  PV UUID               5YZUsZ-zVgG-xW7k-rIsC-EAJa-UmhV-emiLFk
   
  “/dev/sdb3” is a new physical volume of “100.00 MiB”
  — NEW Physical volume —
  PV Name               /dev/sdb3
  VG Name               
  PV Size               100.00 MiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               kCpgqS-Q4mx-AaiR-kydR-7ltE-SepA-xGL7zM
   
  “/dev/sdb1” is a new physical volume of “100.00 MiB”
  — NEW Physical volume —
  PV Name               /dev/sdb1
  VG Name               
  PV Size               100.00 MiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               sy34gi-QIt4-vT7F-xH25-4bE9-luEc-qBThrs
   
  “/dev/sdb2” is a new physical volume of “100.00 MiB”
  — NEW Physical volume —
  PV Name               /dev/sdb2
  VG Name               
  PV Size               100.00 MiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               AQm0MW-yRIU-12LM-dRip-7IIA-bkAe-ncdwvI
   
 
Visualizza un ricapitolativo di lvm

[root@localhost boot]# lvmdiskscan 
  /dev/centos/root [      17.47 GiB] 
  /dev/sda1        [     500.00 MiB] 
  /dev/centos/swap [       2.00 GiB] 
  /dev/sda2        [      19.51 GiB] LVM physical volume
  /dev/sdb1        [     100.00 MiB] LVM physical volume
  /dev/sdb2        [     100.00 MiB] LVM physical volume
  /dev/sdb3        [     100.00 MiB] LVM physical volume
 
Creare i volume group
 
Creo un VG con i due vuoumi fisici, il terzo lo aggiungo dopo per espandere 
 
[root@localhost boot]# vgcreate vg1 /dev/sdb1 /dev/sdb2
  Volume group “vg1” successfully created
 
Visualizzo i volume groups
 
[root@localhost boot]# vgdisplay 
 
 — Volume group —
  VG Name               vg1
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               192.00 MiB
  PE Size               4.00 MiB
  Total PE              48
  Alloc PE / Size       0 / 0   
  Free  PE / Size       48 / 192.00 MiB
  VG UUID               gjGT2M-e1u7-51OB-zER1-2Vtg-A0KW-eRv6OI
 
Creo il volume logico
 
[root@localhost boot]# lvcreate -L 180M vg1 -n lv1
 
Visualizzo il volume logico creato
 
[root@localhost boot]# lvdisplay 
  — Logical volume —
  LV Path                /dev/vg1/lv1
  LV Name                lv1
  VG Name                vg1
  LV UUID                yDJY0o-b56e-OAbq-uoJW-c57K-HDpI-I6tXns
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2015-08-04 12:52:51 +0200
  LV Status              available
  # open                 0
  LV Size                180.00 MiB
  Current LE             45
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  – currently set to     8192
  Block device           253:2
 
 
Formatto e monto il volume logico creato
 
[root@localhost boot]# mkfs.ext4 /dev/vg1/lv1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
46184 inodes, 184320 blocks
9216 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=33816576
23 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks: 
     8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 
 
[root@localhost boot]# mount /dev/vg1/lv1 /mnt/
 
 
Esterndere un volume group
 
Estendo il volume group aggiungendo un’altra partizione
 
[root@localhost boot]# vgextend vg1 /dev/sdb3 
 
 Volume group “vg1” successfully extended
 
Faccio il resize del del volume logico
 
[root@localhost vg1]# lvresize -L +100M /dev/vg1/lv1 
oppure
[root@localhost vg1]# lvresize -l +100%FREE /dev/vg1/lv1 
 
 
Faccio il resize del filesystem del volume logico
 
[root@localhost vg1]# resize2fs /dev/vg1/lv1 
 
 
Rimuovere un Volume logico

[root@localhost /]# cd ..
[root@localhost /]# umount /mnt/
[root@localhost /]# lvremove /dev/vg1/lv1 
Do you really want to remove active logical volume lv1? [y/n]: y
  Logical volume “lv1” successfully removed
 
 
Rimuovere un Volume Group
 
[root@localhost /]# vgremove /dev/vg1
  Volume group “vg1” successfully removed

Rimuovere un Phisical Volume
 
[root@localhost /]# pvremove /dev/sdb1 /dev/sdb2 /dev/sdb3
  Labels on physical volume “/dev/sdb1” successfully wiped
  Labels on physical volume “/dev/sdb2” successfully wiped
  Labels on physical volume “/dev/sdb3” successfully wiped
 
 
 
INFO
 
I Volume group e i Logical Volume si trovano sotto:
/dev/NomeVolumeGroup/NomeLogicalVolume
14 / 100 SEO Score
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
| Reply