忍者ブログ
最新記事
(08/05)
(07/11)
(06/25)
(06/24)
(06/24)
ブログ内検索
カテゴリー
プロフィール
HN:
Toy Scooter
性別:
男性
職業:
はいぱー情報通信・電気くりえーたー
趣味:
読書
自己紹介:
wiki始めました・・・
//
統一性の無いblogになってきました、 資格とかLinuxとか・・・。
[70]  [68]  [67]  [66]  [65]  [64]  [63]  [62]  [61]  [60]  [59
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

基本に返ってパーティション操作です。

前準備としてはここ

まずはパーティションの状態を確認します、
赤太文字部分が追加したパーティションです。
----------------------------------------
debian:/home/tmp#
debian:/home/tmp# ls /dev/hd*
/dev/hda  /dev/hda1  /dev/hda2  /dev/hda3  /dev/hda5  /dev/hdc
debian:/home/tmp#
----------------------------------------

詳細は以下、GPartedでのshutdownの際、
umountでfailedと出力され、多少不安だったのですが
大丈夫な様です。
----------------------------------------
debian:/home/tmp#
debian:/home/tmp# fdisk -l /dev/hda

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda3             460         492      265072+  83  Linux
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Partition table entries are not in disk order
debian:/home/tmp#
----------------------------------------

fdiskコマンドを実行、
現在のパーティション状態を表示しました。
----------------------------------------
debian:/home/tmp# fdisk /dev/hda

Command (m for help): p

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda3             460         492      265072+  83  Linux
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Partition table entries are not in disk order

Command (m for help):
----------------------------------------

/dev/hda3はテストパーティションなので
削除してみます、
削除後にパーティション内容を確認。
----------------------------------------
Command (m for help): d
Partition number (1-5): 3

Command (m for help): p

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Command (m for help):
----------------------------------------

削除したパーティションに
新しいパーティションを作成
別なデバイス番号を割当てました。
----------------------------------------
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
Partition number (1-4): 4
First cylinder (460-522, default 460):
Using default value 460
Last cylinder or +size or +sizeM or +sizeK (460-492, default 492):
Using default value 492

Command (m for help): p

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda4             460         492      265072+  83  Linux
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Partition table entries are not in disk order

Command (m for help):
----------------------------------------

wで書込みです、設定内容が次のreboot迄
有効とならないとの事なのでrebootしましょう、
因みにreboot前にファイルシステムを
作成しようとするとbusyで出来ないと
出力されました。
----------------------------------------
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:


The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
debian:/home/tmp#
----------------------------------------

reboot後にext2フォーマットにて
ファイルシステムを作成。
----------------------------------------
debian:/home/tmp# fdisk -l

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda4             460         492      265072+  83  Linux
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Partition table entries are not in disk order
debian:/home/tmp#
debian:/home/tmp# mkfs -t ext2 /dev/hda4
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
66528 inodes, 265072 blocks
13253 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
33 block groups
8192 blocks per group, 8192 fragments per group
2016 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
debian:/home/tmp#
----------------------------------------

mke2fsコマンドでのフォーマットも試してみました、
cオプションは不良ブロックのチェックも
同時に実行してくれます、
でもmkfsコマンドでも
ext3フォーマット出来るんですよね・・・。
----------------------------------------
debian:/home/tmp#
debian:/home/tmp# mke2fs -cj /dev/hda4
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
66528 inodes, 265072 blocks
13253 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
33 block groups
8192 blocks per group, 8192 fragments per group
2016 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185

Checking for bad blocks (read-only test): done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
debian:/home/tmp#
----------------------------------------

今度は/dev/hda4をswap領域に変更してみます、
fdisk実行後、tを実行、対象パーティションを選択し
変更タイプを確認後、変更するタイプを入力し
パーティションテーブルに書込みます、
パーティションの操作は上手く実行されても
エラーが多々出ます、
reboot後に様子見です。
----------------------------------------


Command (m for help): t
Partition number (1-5): 4
Hex code (type L to list codes): L



 2  XENIX root      39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-


Hex code (type L to list codes): 82
Changed system type of partition 4 to 82 (Linux swap / Solaris)

Command (m for help): p

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda4             460         492      265072+  82  Linux swap / Solaris
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Partition table entries are not in disk order

Command (m for help):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: デバイスもしくはリソースがビジー状態です.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
debian:/home/tmp#
----------------------------------------

reboot後、パーティション内容を確認します、
操作内容が反映されているのですが、
swap領域が複数有る為、変な感じです。
----------------------------------------
debian:/home/tmp#
debian:/home/tmp# fdisk -l

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         459     3686886   83  Linux
/dev/hda2             493         522      240975    5  Extended
/dev/hda4             460         492      265072+  82  Linux swap / Solaris
/dev/hda5             493         522      240943+  82  Linux swap / Solaris

Partition table entries are not in disk order
debian:/home/tmp#
----------------------------------------

swap領域のファイルシステムを作成、
有効化も忘れずに・・・。
----------------------------------------
debian:/home/tmp#
debian:/home/tmp# mkswap /dev/hda4
Setting up swapspace version 1, size = 271429 kB
no label, UUID=ddbb9282-7b44-4e81-8631-25f62d619950
debian:/home/tmp#
debian:/home/tmp# swapon /dev/hda4
debian:/home/tmp#
----------------------------------------

PR
この記事にコメントする
お名前
タイトル
文字色
メールアドレス
URL
コメント
パスワード   Vodafone絵文字 i-mode絵文字 Ezweb絵文字
この記事へのトラックバック
この記事にトラックバックする:
この記事のURL:       
忍者ブログ*[PR]