리눅스 외장하드디스크 포맷방법

[root@localhost ~]# fdisk -l (현재 파티션 테이블 확인)

 

Disk /dev/sda: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14         666     5245222+  83  Linux

/dev/sda3             667        1188     4192965   83  Linux

/dev/sda4            1189        3916    21912660    5  Extended

/dev/sda5            1189        1710     4192933+  83  Linux

/dev/sda6            1711        1841     1052226   82  Linux swap / Solaris

/dev/sda7            1842        3916    16667406   83  Linux

 

Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes (/dev/sdb 장치가 연결된 확인)

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      121602   976759808    7  HPFS/NTFS

 

[root@localhost ~]# fdisk /dev/sdb (파티션 새로 잡음)

 

The number of cylinders for this disk is set to 121601.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p (현재 파티션 구성 보기)

 

Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      121602   976759808    7  HPFS/NTFS

 

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): d (기존 파티션 삭제)

Selected partition 1

 

Command (m for help): p

 

Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   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-121601, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):

Using default value 121601

 

Command (m for help): p

 

Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      121601   976760001   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.

Syncing disks.

[root@localhost ~]# mkfs -t ext3 /dev/sdb1 (파티션 포맷)

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

122109952 inodes, 244190000 blocks

12209500 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

7453 block groups

32768 blocks per group, 32768 fragments per group

16384 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, 214990848

 

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 28 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@localhost ~]# mount -t ext3 /dev/sdb1 /mnt (마운트)

[root@localhost ~]# df -h (마운트 확인)

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda2             4.9G  3.3G  1.4G  70% /

/dev/sda3             3.9G  2.5G  1.3G  67% /opt

/dev/sda5             3.9G  167M  3.6G   5% /var

/dev/sda7              16G  191M   15G   2% /var/gate1

/dev/sda1              99M   12M   83M  13% /boot

tmpfs                 506M     0  506M   0% /dev/shm

/dev/sdb1             917G  200M  871G   1% /mnt

[root@localhost ~]#

위로 스크롤