Storage & Filesystem tools

把hackmd上的筆記搬過來

tools

df

df -h

lsblk

lshw

blkid

blkid -p /dev/sda*

parted

parted -l

modification tools

fdisk

fdisk -l
fdisk /dev/sda # 在sda增加partition
n e default default w #在建立邏輯分割區的時候,會先建立一個Extended
n default +3G w # 然後再把其他分割區建立在其中
partprobe # inform the operating system of partition table changes

e2fsck & resize2fs

check a Linux ext2/ext3/ext4 file system
resize ext2/ext3/ext4 file system

sudo umount /dev/Zeus/video
sudo e2fsck -f /dev/Zeus/video
sudo resize2fs /dev/Zeus/video # resize ext2/ext3/ext4 file system
sudo mount /dev/Zeus/video

filesystem

mke2fs

create an ext2, ext3, or ext4 filesystem

lvm

physical volume

pvs      # vertify pvs
pvcreate # create lvm physical volume

volume groups

vgs      # vertify vgs
vgdisplay
vgcreate # create lvm volume groups
vgextend # extend vg
vgextend Zeus /dev/sda4 # append sda4 into "Zeus"

logical volume

lvs      # vertify lvs
lvcreate # create lvm logical volume
lvextend
lvextend --size +1G /dev/Zeus/video
umount /dev/Zeus/video
e2fsck -f /dev/Zeus/video
resize2fs /dev/Zeus/video # resize ext2/ext3/ext4 file system
mount /dev/Zeus/video

mount 掛載

mount

sudo mkdir /media/USBstick
sudo mount -t vfat /dev/sdb1 /media/USBstick

mount -o remount,rw "/dev/Zeus/video"

umount

sudo umount /dev/sdb1

edit partition

windows: AOMEI Partition Assistant
all: gparted

1 thought on “Storage & Filesystem tools

Leave a Reply

Your email address will not be published. Required fields are marked *