ページ : 1 2
本番共有用仮想ディスク追加
将来の共有フォルダの容量不足に備え、システムとは別の仮想ディスクを作り、共有フォルダ専用としたいと思います。
仮想マシンを一旦シャットダウンさせたら、QNAP Virtualization Stationで仮想マシンの設定から Add Device をクリックして、新規ハードディスクを以下のように追加します。
2つの仮想ストレージになった仮想マシンを立ち上げます。
新規仮想ディスクの初期化
仮想マシン内では、 fdisk で追加された仮想ディスクを確認します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# fdisk -l ## システムはこちら /dev/vda: 10 GiB Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 2099199 2097152 1G 83 Linux /dev/vda2 2099200 20971519 18872320 9G 8e Linux LVM /dev/mapper/almalinux-root: 8 GiB /dev/mapper/almalinux-swap: 1 GiB ## 追加されたのはこちら Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors Disk model: QEMU HARDDISK 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/sda にパーティションを作成します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# fdisk /dev/sda Welcome to fdisk (util-linux 2.37.4). 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 0xf1e740e8. Command (m for help): p Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors Disk model: QEMU HARDDISK 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: 0xf1e740e8 Command (m for help): n Partition type p 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-20971519, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-20971519, default 20971519): Created a new partition 1 of type 'Linux' and of size 10 GiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. |
続いてext4ファイルシステムを作成。
1 2 3 4 5 6 7 8 9 10 11 |
[root@fxsrv ~]# mkfs.ext4 /dev/sda1 mke2fs 1.46.5 (30-Dec-2021) Discarding device blocks: done Creating filesystem with 2621184 4k blocks and 655360 inodes Filesystem UUID: ee85fe71-dd2b-43f6-be43-238cfc6e68d1 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done |
マウントポイントを共有公開
マウントポイントを作成し、
1 |
# mkdir -p /mnt/sda |
/etc/fstab へ自動マウントを記述したら、一度システムを再起動します。
1 |
/dev/sda1 /mnt/sda ext4 default 0 0 |
再起動後、追加した仮想ディスクが利用可能になりました。
1 2 3 4 5 6 |
# df -h /dev/sda1 Filesystem Size Used Avail Use% Mounted on /dev/sda1 9.8G 361M 8.9G 4% /mnt/sda # mount | grep /dev/sda1 /dev/sda1 on /mnt/sda type ext4 (rw,relatime) |
先ほどと同様にアクセス権と所有権を設定します。
1 2 3 4 |
# chmod -R 777 /mnt/sda # chown -R nobody:nobody /mnt/sda # ls -l /mnt/sda drw-rw-rw-. 2 nobody nobody 6 Jul 15 13:22 fax |
Samba設定ファイルで共有パスを /mnt/sda/fax/ へ変更し、サービスを再起動させて完成です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# smbstatus Samba version 4.15.5 PID Username Group Machine Protocol Version Encryption Signing --------------------------------------------------------------------------------------------------------------------------- 7070 nobody nobody 192.168.26.6 (ipv4:192.168.24.6:53880) SMB3_11 - - Service pid Machine Connected at Encryption Signing ----------------------------------------------------------------------------------------- fax 7070 192.168.26.6 Fri Jul 15 03:33:40 PM 2022 HKT - - Locked files: Pid User(ID) DenyMode Access R/W Oplock SharePath Name Time -------------------------------------------------------------------------------------------------- 7070 65534 DENY_NONE 0x100081 RDONLY NONE /mnt/sda/fax . Fri Jul 15 15:33:40 2022 7070 65534 DENY_NONE 0x100081 RDONLY NONE /mnt/sda/fax . Fri Jul 15 15:33:40 2022 |
次回はこのネットワーク共有をWindowsネットワークから見つけてもらいやすくするために、WSDサービスを導入したいと思います。
created by Rinker
¥3,168
(2024/04/24 18:20:11時点 Amazon調べ-詳細)
ページ : 1 2