Skip to content

Instantly share code, notes, and snippets.

@cerealskill
Created January 11, 2019 13:11
Show Gist options
  • Save cerealskill/15240c931ed6266409e4255c4c19a77e to your computer and use it in GitHub Desktop.
Save cerealskill/15240c931ed6266409e4255c4c19a77e to your computer and use it in GitHub Desktop.
Procedimiento para agregar un nuevo disco (Linux)
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
`-sda1 8:1 0 20G 0 part /docs
vda 252:0 0 40G 0 disk
|-vda1 252:1 0 1G 0 part /boot
`-vda2 252:2 0 39G 0 part
|-centos-root 253:0 0 35.1G 0 lvm /
`-centos-swap 253:1 0 3.9G 0 lvm [SWAP]
# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0002b169
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 83886079 40893440 8e Linux LVM
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4210688 bytes / 1048576 bytes
Disk label type: dos
Disk identifier: 0x7b7f09ab
Device Boot Start End Blocks Id System
/dev/sda1 4096 41943039 20969472 83 Linux
Partition 1 does not start on physical sector boundary.
Disk /dev/mapper/centos-root: 37.7 GB, 37706792960 bytes, 73646080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
# fdisk /dev/sdXX
# reboot
# sudo resize2fs /dev/sdXX
# mkfs.ext4 /dev/sdXX
# mkdir folder
# mount -t ext4 /dev/sdXX /folder/
df -h
vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Jan 29 19:11:40 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=e22efc00-1ab1-4ddc-946c-0cfb711f9112 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/mapper/centos-swap none swap sw,comment=cloudconfig 0 0
/dev/sdXX /folder ext4 defaults 0 0
:wq!
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment