SDカード fdisk

LINUXマシンに、ALIX3D2 VOYAGE MPDのNASを使用してSDカードのパーテーションを区切ってみることにした。USB端子にHDDとカードリーダーが接続してある。カードリーダーにマイクロSDHCカードを挿入した。銘柄は、GREEN HOUSE Class4 4GBである。ノートPCからSSHでリモート操作で作業を進めた。SSHソフトは、いつもの様にPoderosaである。








SDカードのデバイス名の確認とパーテーションの区切りの操作手順である。Poderosaの画面テキストをコピーして貼り付けてみた。赤字が実際のキー入力である。SDカードは、Sdbと確認出来る。fdiskでパーテーション1のサイズ +64Mは、他のサイトの事例を参考にした。幾つを指定していいか判断できず真似をさせて頂いた。


root@voyage:~# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sdb  /dev/sdb1
root@voyage:~# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)


Command (m for help): o
Building a new DOS disklabel with disk identifier 0x0c30e95b.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 3904 MB, 3904897024 bytes
100 heads, 35 sectors/track, 2179 cylinders
Units = cylinders of 3500 * 512 = 1792000 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0c30e95b

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2179, default 1):         ・・・・・リターン
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2179, default 2179): +64M

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): e
Changed system type of partition 1 to e (W95 FAT16 (LBA))

Command (m for help): a
Partition number (1-4): 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (39-2179, default 39):        ・・・・・リターン
Using default value 39
Last cylinder, +cylinders or +size{K,M,G} (39-2179, default 2179):
Using default value 2179

Command (m for help): p

Disk /dev/sdb: 3904 MB, 3904897024 bytes
100 heads, 35 sectors/track, 2179 cylinders
Units = cylinders of 3500 * 512 = 1792000 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0c30e95b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          38       66482+   e  W95 FAT16 (LBA)
/dev/sdb2              39        2179     3746750   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

root@voyage:~#

簡単にやれたみたいだが実際には、何度も失敗してやり直した(途中 ひと寝入り挟む)。fdiskのコマンド選択が難しい。他のサイトでデフォルトを選んでいけば良いと書いてあったりするがそんなことはない。別のサイトの手順では一部のコマンド選択が抜けていたりする。鵜呑みにしてそのまま実行するとうまくいかない。失敗しても最初のコマンドoからやり直せば良い。fdiskからやり直す場合は、デバイス名を間違えるとHDDの方を消去してしまうので注意が必要だ。

コメント

このブログの人気の投稿

BDP-S370 SACD SP/DIF同軸出力

LightMPD/upnpgw イーサネット分離モード

10~12cm用バックロードホーン