做視頻類網(wǎng)站需要哪些許可證網(wǎng)絡(luò)運(yùn)營seo是什么
itopen組織
1、提供OpenHarmony優(yōu)雅實(shí)用的小工具
2、手把手適配riscv + qemu + linux的三方庫移植
3、未來計(jì)劃riscv + qemu + ohos的三方庫移植 + 小程序開發(fā)
4、一切擁抱開源,擁抱國產(chǎn)化
一、小于2T磁盤掛載方式
1.1 安裝磁盤到電腦后啟動(dòng)系統(tǒng)
1.2 查找未分區(qū)的磁盤
- 打開終端輸入sudo fdisk -l查找到?jīng)]有分區(qū)的磁盤
- 已經(jīng)分區(qū)的磁盤會(huì)有對(duì)應(yīng)的Device Start End Sectors Size Type信息,而未分區(qū)的磁盤沒有對(duì)應(yīng)的信息,通過查看當(dāng)前/dev/nvme0n1是新增加的未分區(qū)磁盤
$ sudo fdisk -l
[sudo] password for wen_fei:
Disk /dev/nvme0n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors # 未分區(qū)的磁盤
Disk model: Samsung SSD 980 PRO 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/nvme1n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors # 已分區(qū)的磁盤
Disk model: Samsung SSD 980 PRO 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 6F0C9477-25AA-45D6-A027-C7186A2C5918Device Start End Sectors Size Type
/dev/nvme1n1p1 2048 5859327 5857280 2.8G EFI System
/dev/nvme1n1p2 5859328 162109439 156250112 74.5G Linux filesystem
/dev/nvme1n1p3 162109440 220702719 58593280 28G Linux filesystem
/dev/nvme1n1p4 220702720 298827775 78125056 37.3G Linux filesystem
/dev/nvme1n1p5 298827776 376952831 78125056 37.3G Linux filesystem
/dev/nvme1n1p6 376952832 416014335 39061504 18.6G Linux filesystem
/dev/nvme1n1p7 416014336 3907028991 3491014656 1.6T Linux filesystemDisk /dev/nvme2n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors # 已分區(qū)的磁盤
Disk model: Samsung SSD 980 PRO 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B6155B74-845D-4234-B637-4308B3F0C56DDevice Start End Sectors Size Type
/dev/nvme2n1p1 2048 3907028991 3907026944 1.8T Linux filesystem
1.3 磁盤分區(qū)
- 對(duì)未分區(qū)的磁盤執(zhí)行命令sudo fdisk /dev/xxx
- 根據(jù)提示輸入m查看指令信息
- 根據(jù)提示輸入n開始創(chuàng)建分區(qū)
- 根據(jù)提示輸入p表示創(chuàng)建主分區(qū),或者輸入?yún)^(qū)e表示創(chuàng)建邏輯分區(qū):一塊硬盤最多只能創(chuàng)建4個(gè)主分區(qū),邏輯分區(qū)可以創(chuàng)建若干個(gè)
- 根據(jù)提示輸入x表示創(chuàng)建x個(gè)分區(qū)說明: 我們掛載磁盤一般只創(chuàng)建一個(gè)分區(qū)即可,直接輸入1即可
- 根據(jù)提示直接回車設(shè)置分區(qū)開始位置是從第2048個(gè)扇區(qū)開始: 由于EFI的興起,要給EFI代碼留磁盤最開始的1M空間,即2048521/(10241024)=1M,因此分區(qū)默認(rèn)第2048個(gè)扇區(qū)開始
- 根據(jù)提示直接回車設(shè)置分區(qū)結(jié)束位置為磁盤末尾
- 根據(jù)提示輸入w保存分區(qū)設(shè)置
$ sudo fdisk /dev/nvme0n1Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x20e2fdf1.Command (m for help): mHelp:DOS (MBR)a toggle a bootable flagb edit nested BSD disklabelc toggle the dos compatibility flagGenericd delete a partitionF list free unpartitioned spacel list known partition typesn add a new partitionp print the partition tablet change a partition typev verify the partition tablei print information about a partitionMiscm print this menuu change display/entry unitsx extra functionality (experts only)ScriptI load disk layout from sfdisk script fileO dump disk layout to sfdisk script fileSave & Exitw write table to disk and exitq quit without saving changesCreate a new labelg create a new empty GPT partition tableG create a new empty SGI (IRIX) partition tableo create a new empty DOS partition tables create a new empty Sun partition tableCommand (m for help): n
Partition typep primary (0 primary, 0 extended, 4 free)e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-3907029167, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3907029167, default 3907029167):Created a new partition 1 of type 'Linux' and of size 1.8 TiB.Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
1.4 格式化分區(qū)
- 輸入命令sudo mkfs -t ext4 /dev/xxx進(jìn)行格式化磁盤
- 記住生成磁盤的UUID為掛載磁盤使用
$ sudo mkfs -t ext4 /dev/nvme0n1
mke2fs 1.45.5 (07-Jan-2020)
Found a dos partition table in /dev/nvme0n1
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 488378646 4k blocks and 122101760 inodes
Filesystem UUID: 330fdef4-df72-47ab-afa0-0ff08ae4999f
Superblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
1.5 設(shè)置開機(jī)自動(dòng)掛載
- 打開文件/etc/fstab添加新分區(qū)掛載到/data目錄
$ sudo vim /etc/fstab
# /datb was on /dev/nvme3n1p1 during installation
UUID=330fdef4-df72-47ab-afa0-0ff08ae4999f /data ext4 defaults 0 2
1.6 重啟系統(tǒng)
系統(tǒng)重啟后查看已經(jīng)有目錄/data表示掛載新磁盤成功
1.7 刪除分區(qū)
卸載分區(qū):使用sudo umount xxx
對(duì)已分區(qū)的磁盤執(zhí)行命令sudo fdisk /dev/xxx
根據(jù)提示輸入m查看指令信息
根據(jù)提示輸入d開始刪除最后一個(gè)分區(qū),如果想刪除更多的分區(qū),則不停的輸入d即可
根據(jù)提示輸入p表示打印分區(qū)表
根據(jù)提示輸入w表示保存分區(qū)設(shè)置
刪除/etc/fstab中原UUID掛載的磁盤
$ sudo fdisk /dev/nvme0n1Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): mHelp:DOS (MBR)a toggle a bootable flagb edit nested BSD disklabelc toggle the dos compatibility flagGenericd delete a partitionF list free unpartitioned spacel list known partition typesn add a new partitionp print the partition tablet change a partition typev verify the partition tablei print information about a partitionMiscm print this menuu change display/entry unitsx extra functionality (experts only)ScriptI load disk layout from sfdisk script fileO dump disk layout to sfdisk script fileSave & Exitw write table to disk and exitq quit without saving changesCreate a new labelg create a new empty GPT partition tableG create a new empty SGI (IRIX) partition tableo create a new empty DOS partition tables create a new empty Sun partition tableCommand (m for help): d
Selected partition 1
Partition 1 has been deleted.Command (m for help): p
Disk /dev/nvme0n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 980 PRO 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcd706ecbCommand (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
二、大于2T磁盤掛載方式
2.1 安裝磁盤到電腦后啟動(dòng)系統(tǒng)
2.2 查找未分區(qū)的磁盤
- 打開終端輸入sudo fdisk -l查找到?jīng)]有分區(qū)的磁盤
- 已經(jīng)分區(qū)的磁盤會(huì)有對(duì)應(yīng)的Device Start End Sectors Size Type信息,而未分區(qū)的磁盤沒有對(duì)應(yīng)的信息,通過查看當(dāng)前/dev/nvme0n1是新增加的未分區(qū)磁盤
$ sudo fdisk -l
[sudo] password for wen_fei:
Disk /dev/nvme0n1: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors
Disk model: Lexar SSD ARES 4TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/nvme1n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors # 已分區(qū)的磁盤
Disk model: Samsung SSD 980 PRO 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 6F0C9477-25AA-45D6-A027-C7186A2C5918Device Start End Sectors Size Type
/dev/nvme1n1p1 2048 5859327 5857280 2.8G EFI System
/dev/nvme1n1p2 5859328 162109439 156250112 74.5G Linux filesystem
/dev/nvme1n1p3 162109440 220702719 58593280 28G Linux filesystem
/dev/nvme1n1p4 220702720 298827775 78125056 37.3G Linux filesystem
/dev/nvme1n1p5 298827776 376952831 78125056 37.3G Linux filesystem
/dev/nvme1n1p6 376952832 416014335 39061504 18.6G Linux filesystem
/dev/nvme1n1p7 416014336 3907028991 3491014656 1.6T Linux filesystemDisk /dev/nvme2n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors # 已分區(qū)的磁盤
Disk model: Samsung SSD 980 PRO 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B6155B74-845D-4234-B637-4308B3F0C56DDevice Start End Sectors Size Type
/dev/nvme2n1p1 2048 3907028991 3907026944 1.8T Linux filesystem
2.3 磁盤分區(qū)
- 對(duì)未分區(qū)的磁盤執(zhí)行命令sudo parted /dev/xxx
- 根據(jù)提示輸入mklabel gpt建立GPT分區(qū)
- 根據(jù)提示輸入Yes開始創(chuàng)建分區(qū)
- 根據(jù)提示輸入mkpart primary ext4 0% 100%創(chuàng)建主分區(qū)
- 根據(jù)提示輸入print查看詳細(xì)信息
- 根據(jù)提示輸入quit退出
$ sudo parted /dev/nvme0n1
GNU Parted 3.3
Using /dev/nvme0n1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/nvme0n1 will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? Yes
(parted) mkpart primary ext4 0% 100%
(parted) print
Model: Lexar SSD ARES 4TB (nvme)
Disk /dev/nvme0n1: 4097GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:Number Start End Size File system Name Flags1 1049kB 4097GB 4097GB ext4 primary(parted) quit
Information: You may need to update /etc/fstab.
2.4 格式化分區(qū)
- 輸入命令sudo mkfs -t ext4 /dev/xxx進(jìn)行格式化磁盤
- 記住生成磁盤的UUID為掛載磁盤使用
$ sudo mkfs -t ext4 /dev/nvme0n1
mke2fs 1.45.5 (07-Jan-2020)
/dev/nvme0n1 contains a ext4 file systemcreated on Wed Jul 3 17:44:09 2024
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 1000196694 4k blocks and 250052608 inodes
Filesystem UUID: 7918bc9f-458c-442f-b586-53fa657b4ad2
Superblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848, 512000000, 550731776, 644972544Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
2.5 設(shè)置開機(jī)自動(dòng)掛載
- 打開文件/etc/fstab添加新分區(qū)掛載到/data目錄
$ sudo vim /etc/fstab
# /datb was on /dev/nvme3n1p1 during installation
UUID=7918bc9f-458c-442f-b586-53fa657b4ad2 /data ext4 defaults 0 2
2.6 重啟系統(tǒng)
- 系統(tǒng)重啟后查看已經(jīng)有目錄/data表示掛載新磁盤成功