2008-05-24
■ [Linux] 外付けUSBハードディスク全体をext3でフォーマットする方法
手順
デバイスファイルをdmesgで確認する。
$ dmesg : [ 161.590623] usb 4-6: new high speed USB device using ehci_hcd and address 5 [ 161.723932] usb 4-6: configuration #1 chosen from 1 choice [ 161.724642] hub 4-6:1.0: USB hub found [ 161.731130] hub 4-6:1.0: 4 ports detected [ 162.034285] usb 4-6.2: new high speed USB device using ehci_hcd and address 6 [ 162.176004] usb 4-6.2: configuration #1 chosen from 1 choice [ 162.186983] scsi4 : SCSI emulation for USB Mass Storage devices [ 162.193848] usb-storage: device found at 6 [ 162.193852] usb-storage: waiting for device to settle before scanning [ 289.830611] usb-storage: device scan complete [ 289.834729] scsi 4:0:0:0: Direct-Access Hitachi HDP725050GLA360 PQ: 0 ANSI: 2 [ 289.846442] sd 4:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB) [ 289.848683] sd 4:0:0:0: [sdb] Write Protect is off [ 289.848691] sd 4:0:0:0: [sdb] Mode Sense: 38 00 00 00 [ 289.848696] sd 4:0:0:0: [sdb] Assuming drive cache: write through [ 289.849939] sd 4:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB) [ 289.852183] sd 4:0:0:0: [sdb] Write Protect is off [ 289.852190] sd 4:0:0:0: [sdb] Mode Sense: 38 00 00 00 [ 289.852195] sd 4:0:0:0: [sdb] Assuming drive cache: write through [ 289.852202] sdb: unknown partition table [ 165.485707] sd 4:0:0:0: [sdb] Attached SCSI disk [ 165.485762] sd 4:0:0:0: Attached scsi generic sg2 type 0
fdiskする。
$ sudo fdisk /dev/sdb デバイスは正常な DOS 領域テーブルも、Sun, SGI や OSF ディスクラベルも 含んでいません Building a new DOS disklabel with disk identifier 0xd00c4851. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. このディスクのシリンダ数は 60801 に設定されています。 間違いではないのですが、1024 を超えているため、以下の場合 に問題を生じうる事を確認しましょう: 1) ブート時に実行するソフトウェア (例. バージョンが古い LILO) 2) 別の OS のブートやパーティション作成ソフト (例. DOS FDISK, OS/2 FDISK) 警告: 領域テーブル 4 の不正なフラグ 0x0000 は w(書き込み)によって 正常になります コマンド (m でヘルプ): m コマンドの動作 a ブート可能フラグをつける b bsd ディスクラベルを編集する c dos 互換フラグをつける d 領域を削除する l 既知の領域タイプをリスト表示する m このメニューを表示する n 新たに領域を作成する o 新たに空の DOS 領域テーブルを作成する p 領域テーブルを表示する q 変更を保存せずに終了する s 空の Sun ディスクラベルを作成する t 領域のシステム ID を変更する u 表示/項目ユニットを変更する v 領域テーブルを照合する w テーブルをディスクに書き込み、終了する x 特別な機能 (エキスパート専用) コマンド (m でヘルプ): n コマンドアクション e 拡張 p 基本領域 (1-4) p 領域番号 (1-4): 1 最初 シリンダ (1-60801, default 1): Using default value 1 終点 シリンダ または +サイズ または +サイズM または +サイズK (1-60801, default 60801): Using default value 60801 コマンド (m でヘルプ): p Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = シリンダ数 of 16065 * 512 = 8225280 bytes Disk identifier: 0xd00c4851 デバイス Boot Start End Blocks Id System /dev/sdb1 1 60801 488384001 83 Linux コマンド (m でヘル ): w 領域テーブルは交換されました! ioctl() を呼び出して領域テーブルを再読込みします。 ディスクを同期させます。
mkfs.ext3する。
$ sudo mkfs.ext3 /dev/sdb1 mke2fs 1.40.8 (13-Mar-2008) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 30531584 inodes, 122096000 blocks 6104800 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 3727 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 34 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
トラックバック - http://d.hatena.ne.jp/SumiTomohiko/20080524/1211628731
リンク元
- 58 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rls=GGLD,GGLD:2004-28,GGLD:ja&q=ヤマネコの宿
- 57 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=org.mozilla:ja:official&hs=jVF&q=UnicodeEncodeError:+&btnG=検索&lr=lang_ja
- 41 http://www.google.co.jp/search?q=python+コメント&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ja:official&client=firefox-a
- 35 http://www.creation.gr.jp/sc40/cn/a.html
- 27 http://www.google.com/search?hl=ja&lr=lang_ja&ie=UTF-8&oe=UTF-8&q=symfony+cache&num=50
- 18 http://www.google.co.jp/search?hl=ja&client=firefox&rls=org.mozilla:ja:official&hs=gtb&q=UnicodeEncodeError&btnG=検索&lr=lang_ja
- 18 http://www.google.co.jp/search?hl=ja&lr=lang_ja&client=firefox-a&rls=org.mozilla:ja:official&hs=pZR&q=sqlite+トランザクション+ロック&revid=280325863&sa=X&oi=revisions_inline&resn
- 17 http://discypus.jp/wiki/?ソフト/Bug Tracking/trac/pluginのインストール
- 17 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=com.ubuntu:ja:unofficial&hs=Jpo&q=python+egg+info&btnG=検索&lr=lang_ja
- 16 http://www.google.co.jp/search?client=firefox-a&rls=org.mozilla:ja:official&channel=s&hl=ja&q=Python+コメント&lr=&btnG=Google+検索