Mount all disks and NVMe SSDs

gene_x 0 like s 452 view s

Tags: research

  • 2x 4 TB M.2 NVMe SSD WD Black SN850X mit 1.200.000 IOPS und einer Haltbarkeit von 2400 TBW (Ubuntu on one of the disks!)
  • 4x 3,84 TB U.2 NVMe Samsung PM9A3, jeweils mit 1.000.000 IOPS, 7008 TBW und 1 Drive Write Per Day (DWD)
  • 3,2 TB NVMe SSD Samsung PM1735 Series mit 1.500.000 IOPS, 17520 TBW und PCIe 4.0 x8 Anbindung
  • 6x 22 TB Western Digital Ultrastar DC HC570 mit 512 MB Cache, einer Drehzahl von 7200 U/min und S-ATA 6Gb/s Schnittstelle (1+2 RAID1; 3-6 RAID10)
    lsblk #or sudo fdisk -l
    

NVMe SSD for Ubuntu nvme5n1 259:3 0 3,6T 0 disk ├─nvme5n1p1 259:4 0 512M 0 part /boot/efi └─nvme5n1p2 259:5 0 3,6T 0 part /var/snap/firefox/common/host-hunspell /

RAID Disks sda 8:0 0 20T 0 disk └─md0 9:0 0 20T 0 raid1 sdb 8:16 0 20T 0 disk └─md0 9:0 0 20T 0 raid1 sdc 8:32 0 20T 0 disk └─md1 9:1 0 40T 0 raid10 sdd 8:48 0 20T 0 disk └─md1 9:1 0 40T 0 raid10 sde 8:64 0 20T 0 disk └─md1 9:1 0 40T 0 raid10 sdf 8:80 0 20T 0 disk └─md1 9:1 0 40T 0 raid10

  1. Check Existing Filesystems on RAID Arrays: First, check if there are existing filesystems on your RAID arrays (md0 and md1). This will determine whether you need to create new filesystems.

    sudo file -s /dev/md0
    sudo file -s /dev/md1
    
  2. Create Filesystems (If Necessary): If the RAID arrays don't have filesystems, you'll need to create them. Below, we're using ext4, but you can substitute it with your preferred filesystem type.

    sudo mkfs.ext4 /dev/md0
    sudo mkfs.ext4 /dev/md1
    
  3. Create Mount Points: You need directories to serve as mount points for your filesystems.

    sudo mkdir /mnt/md0
    sudo mkdir /mnt/md1
    
  4. Mount the Filesystems: Mount the newly created filesystems to the mount points.

    sudo mount /dev/md0 /mnt/md0
    sudo mount /dev/md1 /mnt/md1
    
  5. Auto-Mount at Boot: To ensure these filesystems are mounted automatically at boot, add them to /etc/fstab. First, open the file with a text editor, such as nano:

    sudo nano /etc/fstab
    
    #Then, add the following lines to the end of the file:
    
    /dev/md0    /mnt/md0    ext4    defaults    0    0
    /dev/md1    /mnt/md1    ext4    defaults    0    0
    
    #Save and close the file. To check if your fstab file is correct and will not cause boot issues, you can simulate its effect:
    
    sudo mount -a
    
    #This command attempts to mount all filesystems mentioned in fstab.
    

If any of your remaining NVMe SSDs need to be mounted or have their partitions mounted, follow similar steps:

  • nvme0n1 259:7 0 3,5T 0 disk (3,84 TB U.2 NVMe Samsung PM9A3)
  • nvme1n1 259:8 0 3,5T 0 disk (3,84 TB U.2 NVMe Samsung PM9A3)
  • nvme2n1 259:1 0 2,9T 0 disk (3,2 TB NVMe SSD Samsung PM1735 Series)
  • nvme3n1 259:9 0 3,5T 0 disk (3,84 TB U.2 NVMe Samsung PM9A3)
  • nvme4n1 259:6 0 3,5T 0 disk (3,84 TB U.2 NVMe Samsung PM9A3)
  • nvme6n1 259:2 0 3,6T 0 disk (4 TB M.2 NVMe SSD WD Black SN850X)

  • Create a Partition (if necessary): You might need to create partitions using tools like fdisk or parted. For a simple, single partition setup, you can use:

    sudo fdisk /dev/nvme0n1
    sudo fdisk /dev/nvme1n1
    sudo fdisk /dev/nvme2n1
    
    #设备不包含可识别的分区表。
    #The size of this disk is 3,5 TiB (3840755982336 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).
    
    命令(输入 m 获取帮助): g
    已创建新的 GPT 磁盘标签(GUID 分区表)。
    
    命令(输入 m 获取帮助): n
    分区号 (1-128, 默认 1):
    起始扇区 (2048-7501476526, 默认 2048):
    最后扇区, +/-扇区 or +/-size{K,M,G,T,P} (2048-7501476526, 默认 7501476526):
    创建了一个新分区 1,类型为“Linux filesystem”,大小为 3,5 TiB。
    
    命令(输入 m 获取帮助): w
    正在写入分区表...
    已完成。
    
  • And follow the prompts to create a new partition. Create a Filesystem:

    sudo mkfs.ext4 /dev/nvme0n1p1  # Assuming the partition created is nvme0n1p1
    sudo mkfs.ext4 /dev/nvme1n1p1
    sudo mkfs.ext4 /dev/nvme2n1p1
    sudo mkfs.ext4 /dev/nvme3n1p1
    sudo mkfs.ext4 /dev/nvme4n1p1
    sudo mkfs.ext4 /dev/nvme6n1p1
    
  • Mount the Filesystem: First, create a mount point, for example:

    sudo mkdir /mnt/nvme0n1p1
    sudo mkdir /mnt/nvme1n1p1
    sudo mkdir /mnt/nvme2n1p1
    sudo mkdir /mnt/nvme3n1p1
    sudo mkdir /mnt/nvme4n1p1
    sudo mkdir /mnt/nvme6n1p1
    
  • Then, mount the partition:

    sudo mount /dev/nvme0n1p1 /mnt/nvme0n1p1
    sudo mount /dev/nvme1n1p1 /mnt/nvme1n1p1
    sudo mount /dev/nvme2n1p1 /mnt/nvme2n1p1
    sudo mount /dev/nvme3n1p1 /mnt/nvme3n1p1
    sudo mount /dev/nvme4n1p1 /mnt/nvme4n1p1
    sudo mount /dev/nvme6n1p1 /mnt/nvme6n1p1
    
  • Add to fstab for Auto-Mount:

    /dev/nvme0n1p1    /mnt/nvme0n1p1    ext4    defaults    0    0
    /dev/nvme1n1p1    /mnt/nvme1n1p1    ext4    defaults    0    0
    /dev/nvme2n1p1    /mnt/nvme2n1p1    ext4    defaults    0    0
    /dev/nvme3n1p1    /mnt/nvme3n1p1    ext4    defaults    0    0
    /dev/nvme4n1p1    /mnt/nvme4n1p1    ext4    defaults    0    0
    /dev/nvme6n1p1    /mnt/nvme6n1p1    ext4    defaults    0    0
    
    sudo mount -a
    
  • Final Note:

    jhuang@WS-2290C:/etc$ df -h
    文件系统        大小  已用  可用 已用% 挂载点
    tmpfs           101G  4,0M  101G    1% /run
    efivarfs        512K   84K  424K   17% /sys/firmware/efi/efivars
    /dev/nvme5n1p2  3,6T   17G  3,4T    1% /
    tmpfs           504G   61M  504G    1% /dev/shm
    tmpfs           5,0M  4,0K  5,0M    1% /run/lock
    /dev/nvme5n1p1  511M  6,1M  505M    2% /boot/efi
    tmpfs           101G  152K  101G    1% /run/user/1001
    /dev/md0         20T   24K   19T    1% /mnt/md0
    /dev/md1         40T   24K   38T    1% /mnt/md1
    /dev/nvme0n1p1  3,5T   28K  3,3T    1% /mnt/nvme0n1p1
    /dev/nvme1n1p1  3,5T   28K  3,3T    1% /mnt/nvme1n1p1
    /dev/nvme2n1p1  2,9T   28K  2,8T    1% /mnt/nvme2n1p1
    /dev/nvme3n1p1  3,5T   28K  3,3T    1% /mnt/nvme3n1p1
    /dev/nvme4n1p1  3,5T   28K  3,3T    1% /mnt/nvme4n1p1
    /dev/nvme6n1p1  3,6T   28K  3,4T    1% /mnt/nvme6n1p1
    

like unlike

点赞本文的读者

还没有人对此文章表态


本文有评论

没有评论

看文章,发评论,不要沉默


© 2023 XGenes.com Impressum