mount
df
lsblk
findmnt
───────────────────────────────────────────────
findmnt /
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mmcblk0p2 ext4 rw,noatime
|
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 128M 0 part
└─sda2 8:2 0 3.7T 0 part
mmcblk0 179:0 0 59.6G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 59.4G 0 part /
|
Formate
gdisk /dev/sdb
:"
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): Y
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.
"
gdisk /dev/sdb
:"
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): v
No problems found. 7814037101 free sectors (3.6 TiB) available in 1
segments, the largest of which is 7814037101 (3.6 TiB) in size.
Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-7814037134, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-7814037134, default = 7814037134) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8300
Changed type of partition to 'Linux filesystem'
Command (? for help): v
No problems found. 2014 free sectors (1007.0 KiB) available in 1
segments, the largest of which is 2014 (1007.0 KiB) in size.
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.
"
mkfs.ext4 /dev/sdb1
mkdir -p /nas/nas_00
chmod 775 /nas/nas_00
mount /dev/sdb1 /nas/nas_00
lsblk
:"
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 256M 0 part /boot
└─sda2 8:2 0 465.5G 0 part /
sdb 8:16 0 3.7T 0 disk
└─sdb1 8:17 0 3.7T 0 part /nas/nas_00
"
Auto Mount
blkid
:'
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="6284-658D" TYPE="vfat" PARTUUID="d8d2ce21-01"
/dev/sda2: LABEL="rootfs" UUID="3a324232-335f-4617-84c3-d4889840dc93" TYPE="ext4" PARTUUID="d8d2ce21-02"
/dev/sdb1: UUID="d585a513-6325-450d-95d8-7c7f1d56f08e" TYPE="ext4" PARTLABEL="nas0" PARTUUID="387a56e5-25a9-4953-8d50-00c2d6ad6539"
'
fstab entry might be like below:
PARTUUID=387a56e5-25a9-4953-8d50-00c2d6ad6539 /nas/nas_00 ext4 auto,nofail,x-systemd.device-timeout=30 0 0
PARTUUID=387a56e5-25a9-4953-8d50-00c2d6ad6539 /nas/nas_00 ext4 nofail,x-systemd.device-timeout=30 0 0
PARTUUID=387a56e5-25a9-4953-8d50-00c2d6ad6539 /nas/nas_00 ext4 auto,nofail,noatime,rw,user 0 0
PARTUUID=387a56e5-25a9-4953-8d50-00c2d6ad6539 /nas/nas_00 ext4 defaults,nofail,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
cat /etc/fstab
:"
proc /proc proc defaults 0 0
PARTUUID=d8d2ce21-01 /boot vfat defaults 0 2
PARTUUID=d8d2ce21-02 / ext4 defaults,noatime 0 1
PARTUUID=387a56e5-25a9-4953-8d50-00c2d6ad6539 /nas/nas_00 ext4 auto,nofail,noatime,rw,user 0 0
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
"
mount -a
findmnt --verify
findmnt --verify --verbose
findmnt --verify --tab-file /etc/fstab --verbose
lsblk
:"
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 256M 0 part /boot
└─sda2 8:2 0 465.5G 0 part /
sdb 8:16 0 3.7T 0 disk
└─sdb1 8:17 0 3.7T 0 part /nas/nas_00
"
Mounting
mount
───────────────────────────────────────────────
lsblk
mkdir /mnt/chorke
mount /dev/sda2 /mnt/chorke/
ls -lah /mnt/chorke/
|
unmount
───────────────────────────────────────────────
lsblk
umount /mnt/chorke/
ls -lah /mnt/chorke/
rm -rf /mnt/chorke/
|
Unmounting
udisks2 (new system)
───────────────────────────────────────────────
lsblk
udisksctl unmount -b /dev/sda1
udisksctl power-off -b /dev/sda
|
udisks (old system)
───────────────────────────────────────────────
lsblk
udisks --unmount /dev/sda1
udisks --detach /dev/sda
|
Resize Volume Group
1. unmount:
sudo umount /dev/mmcblk0p3
2. resize: physical volume
sudo pvresize /dev/mmcblk0p3
3. validate: physical volume size
sudo pvs
4. resize: logical volume
sudo lvresize -L +20480 fedora_fedora/root /dev/mmcblk0p3
sudo lvresize -L +20G fedora_fedora/root /dev/mmcblk0p3
sudo lvresize -l +100%FREE /dev/fedora_fedora/root
df -h /
sudo xfs_growfs /dev/fedora_fedora/root
sudo resize2fs /dev/fedora_fedora/root
5. validate: logical volume size
sudo lvs
df -h /
6. remount:
sudo mount -a
Knowledge
───────────────────────────────────────────────
apt update
apt install lshw
apt install fuse3
apt install eject
apt install gdisk
apt install rsync
apt install hdparm
apt install ntfs-3g
apt install udisks2
apt install progress
apt install nfs-common
cat /proc/mounts
mount|grep ^/dev
ls -la /mnt/
mount -a
mv /opt/finology/ /nas/nas_00/
ln -s /nas/nas_00/finology /opt/finology
chown -h pi:pi /opt/finology
|
───────────────────────────────────────────────
rsync -r --progress source target
udisksctl unmount -b /dev/sda1
lsblk -o NAME,FSTYPE,UUID
cat /proc/self/mounts
hdparm -N /dev/sda
watch progress -w
ls -la /dev/sda*
eject /dev/dvd
parted -l
fdisk -l
mount -l
df -aTh
df -hT
mount
lshw
sudo parted -l|grep ntfs
sudo mkdir /mnt/e-drive
sudo mount -t ntfs-3g /dev/nvme0n1p5 /mnt/e-drive
|
SD Clone
apt search piclone
apt install piclone
./sdclone /dev/sda /dev/mmcblk0
./sdclone /dev/sda /dev/macblk0
RPI Clone
If sda size more than 2TB
git clone https://github.com/billw2/rpi-clone.git; cd rpi-clone
cp rpi-clone rpi-clone-setup /usr/local/sbin
rpi-clone-setup -t testhostname
rpi-clone -f -p 256M sda
References