DEV Community

Guilherme Dakuzaku
Guilherme Dakuzaku

Posted on

1 2

[Linux] Disco em XFS

Muitas vezes na carreira de DBA eu já formatei discos em Linux e dessas diversas vezes fazendo filesystems e outros lugares, acabei sempre fazendo em ext3, porém hoje fiz em xfs, pois é o padrão da empresa.

Vem o passo a passo:

  1. Criar pasta que vai ser o fs
    mkdir /teste

  2. Add disco na máquina.

  3. Criar partição

fdisk -l
fdisk /dev/sdb
Enter fullscreen mode Exit fullscreen mode

4 - Formatar a particao com o xfs.

[root@teste01 ~]# mkfs.xfs -f /dev/sdb1
meta-data=/dev/sdb1              isize=512    agcount=4, agsize=655296 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=2621184, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Enter fullscreen mode Exit fullscreen mode
  1. Pegar o uuid:
[root@teste01 ~]# blkid
/dev/sda1: UUID="de86b48a-914b-4104-9fd8-f9dd8OO452ea" TYPE="xfs" 
/dev/sr0: UUID="2006-12-25-15-55-36-00" LABEL="CONTEXT" TYPE="iso9660" 
/dev/sdb1: UUID="c4405025-7854-4xae-b5de-2c2d2tcd43do" TYPE="xfs" 
Enter fullscreen mode Exit fullscreen mode
  1. Add no /etc/fstab
vi /etc/fstab
UUID=c4405025-7854-4xae-b5de-2c2d2tcd43do /teste               xfs    defaults 1       2
Enter fullscreen mode Exit fullscreen mode
  1. Montar o fs.
mount /teste
# se der erro, tratar.
Enter fullscreen mode Exit fullscreen mode
  1. Teste pra ver se há leitura e escrita.
[root@teste01 ~]# touch /teste/1.txt
# se der erro, tratar possivel erro é de read-only.
# se nao der erro, 
rm -rf /teste/1.txt
Enter fullscreen mode Exit fullscreen mode
  1. (opcional) restart o servidor para testar se está subindo o disco.
shutdown -r now
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay