domingo, 10 de maio de 2020

lvm - Aprendi Até que Enfim!

Sempre tive essa pendência comigo, aprender a usar o lvm!

Tirei o domingo para aprender.

Valeu a pena!

Segue o fio...




Assisti alguns videos, gostei muito do video do Linuxtips, o cara é foda o video é de 5 anos atrás, e do Linux 4Fasters.

Vou compartilhar o que eu fiz.

  1. Criei uma maquina virtual com ubuntu-mate-20.04 no virtualbox
  2. Adicionei 2 discos nela, 1 de 50GB e outro de 100GB
  3. Executei a instalação no formato lvm no disco menor de 50GB
  4. Após o fim da instalação, reniciei a maquina virtual com o livecd do ubuntu usado para instalação
  5. Então, após assistir os videos q listei acima, executei os comandos, na ordem:
0- lista mount points
$ lsblk

1- listar physical volumes
$ pvs
pv = /dev/sda2
gv = /vgubuntu-mate

2- listar volumes grups
$ vgs
vg = vgubuntu-mate

3- listar logical volumes
$ lvs
vg = vgubuntu-mate
lv = root 
lv swap_1

4- reduzir para 25GB o lv root
$ lvreduce /dev/vgubuntu-mate/root -L25GB -r

5- criar um lv 25GB chamado home no vgubuntu-mate
$ lvcreate  -n home -L23.54GB vgubuntu-mate

6- formatar novo lv = home
mkfs.ext4 /dev/sda2/vgubuntu-mate/home

6- copiar os arquivos do lv = root on /home para o lv = home on /home
criar diretorio de montagem temporario
$ mkdir /tmp/root
$ mount /dev/vgubuntu-mate/root /tmp/root
$ mkdir /tmp/home
$ mount /dev/vgubuntu-mate/home /tmp/home
$ du -sh /tmp/root/home
$ du -sh /tmp/home
$ rsync -a /tmp/root/home /tmp
$ mv /tmp/root/home /tmp/root/home-old

7- alterar o fstab para apontar para lv = home on /home
$ cat /tmp/root/etc/fstab
$ vim /tmp/root/etc/fstab

copiei a linha:
/dev/mapper/vgubuntu--mate-root / ext4 erros=remount-ro 0 1

colei como:
/dev/mapper/vgubuntu--mate-home /home ext4 erros=remount-ro 0 1
salvar!

8- dar boot e verificar

9- se tudo ok, apagar /home on lv = root


    Fiz outro boot na maquina virutal e funcionou perfeitamente!

    Sensacional, pessoal!

    Partição fisica nunca mais! 

    Pretendo fazer mais posts, com testes migração do ubuntu mate 18.04 para 20.04 com lvm.

    Abraços!
   Igor Ferreira Dev.

2 comentários:

  1. Betting on the vendor is finest option|the 1xbet korea finest choice|the best suited choice}, but wins are charged a 5% commission. Based on the NGCC’s 2009 report, Korea’s fee of playing addiction is 6.1 % of the whole population, about 3,000,000, individuals. This fee is up to as} triple that of advanced countries similar to the united states, Australia, and Canada. A lot of this has to do with truth that|the reality that} South Korea’s companies all cope with overseas shoppers and partners, thus making it essential to use VPNs to safe information and visit websites that may in any other case be banned. The distant server decrypts these requests and attaches them to an IP address from the corporate the server is situated in. The authorities then has provisions for exactly one casino for Korean residents, 16 for tourists, and playing on sports activities from motorboat racing to cycle racing to traditional bullfighting, along with four lotteries.

    ResponderExcluir
  2. Among other issues, guests will discover a daily dose of articles with the latest poker news, live reporting from tournaments, unique videos, podcasts, reviews and bonuses and a lot extra. If you comply with my advice on starting from the minimal guess, which means you might be} at all times going to 2x your shedding guess + adding yet one more minimal guess on prime of that. Be sure begin out|to begin} from the lowest guess allowed and to comply with the development carefully. Being this an article for beginners who want to if there's a way to learn the way to win on roulette (there is't), I am not going to go too deep on the subject. It's only if you discover ways to|learn to} apply the roulette 우리카지노 tips I'm providing you with right here that you're going to|that you will} know how to to|tips on how to} get your finest shot at roulette. Any system, thus far devised, could be analysed to show out|to indicate} might be} a|that there's a} win expectation for the casino.

    ResponderExcluir

lvm - Aprendi Até que Enfim!

Sempre tive essa pendência comigo, aprender a usar o lvm! Tirei o domingo para aprender. Valeu a pena! Segue o fio... Assisti alguns videos,...