スポンサーリンク

上記の広告は、30日以上更新がないブログに表示されています。
新たに記事を投稿することで、広告を消すことができます。  

Posted by だてBLOG運営事務局 at

2016年09月29日

Ubuntu15.04 HDD(SSD)増設

タイトル的にはHDD(SSD)増設だが
mediatomb をセットアップし
メディアサーバーにしているUbuntu15.04に
不稼働になった自作PCから50GBのSSDを取り出し
HD画質動画の転送と再生にも対応させるべく
メディア保存用として増設することにした
増設するのは古いATOMなCPUのベアボーンだが
まだまだ現役で使えるPCだ

まずは接続したSSDが認識されているか確認する

ls /dev | grep sdb
sdb
sdb1


すでにWindows上でパーティション削除してあるので
fdisk で確認しつつパーティション作成

fdisk /dev/sdb

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


コマンド (m でヘルプ): p
Disk /dev/sdb: 46.6 GiB, 50020540416 bytes, 97696368 sectors
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: 0xa864bb23

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 97696367 97694320 46.6G 7 HPFS/NTFS/exFAT

やらなくてもよかったけど
NTFSにフォーマットを変更

コマンド (m でヘルプ): t
Selected partition 1
Hex code (type L to list all codes): 86
Changed type of partition 'HPFS/NTFS/exFAT' to 'NTFS volume set'.

コマンド (m でヘルプ): p
Disk /dev/sdb: 46.6 GiB, 50020540416 bytes, 97696368 sectors
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: 0xa864bb23

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 97696367 97694320 46.6G 86 NTFS volume set


コマンド (m でヘルプ): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


sfdisk で確認する

sfdisk -l /dev/sdb

ディスク /dev/sdb: シリンダ数 6081、ヘッド数 255、63 セクタ/トラック
sfdisk: Warning: The partition table looks like it was made
for C/H/S=*/81/63 (instead of 6081/255/63).
For this listing I'll assume that geometry.
Units: cylinders of 2612736 bytes, blocks of 1024 bytes, counting from 0

デバイス 起動 始点 終点 #シリンダ #ブロック ID システム
/dev/sdb1 0+ 19144- 19145- 48847160 86 NTFS ボリュームセット
終点: (c,h,s) 期待値=(1023,80,63) 検出値=(961,80,63)
/dev/sdb2 0 - 0 0 0 空
/dev/sdb3 0 - 0 0 0 空
/dev/sdb4 0 - 0 0 0 空


blkid でUUIDとLABELを確認する

blkid | grep sdb1
/dev/sdb1: LABEL="mediatomb" UUID="26911F4533B86E52"
TYPE="ntfs" PARTUUID="a864bb23-01"


マウントポイントを作成
/media にマウントするのが
最近のHDD増設では通例であるが
タカさんは天邪鬼なので
/mnt にマウントポイントを作成

mkdir /mnt/mediatomb
chown nobody:nogroup /mnt/mediatomb
chmod 777 /mnt/mediatomb


Windows側でフォーマットした時に
マウントしやすいようにLABEL名を設定しておいたので
めんどくさいUUIDではなく
fstabにはLABELを利用して末尾に設定を書き込む

vi /etc/fstab
LABEL=mediatomb /mnt/mediatomb ntfs errors=remount-ro 0 1


あとは再起動

shutdown -r now

ログインしなおしてコマンドでマウント状態を確認

df /dev/sdb1
Filesystem 1K-blocks Used   Available Use% Mounted on
/dev/sdb1 48847156 1953886 16893269  4% /mnt/mediatomb


マウントも確認できSSDの増設完了!!  


Posted by タカさん at 00:55Comments(0)Unix・Linux