티스토리 뷰

___리눅스

[linux] 하드디스크 증설(추가)

변군 변군이글루 2013. 6. 17. 23:23

하드디스크 증설(추가)

 

1. 하드(HDD)디스크 장착

2. 장착 후 리붓팅

3. fdisk l 로 물리적 하드디스크 확인(추가 된 /dev/sdb)

[root@sangchul ~]# fdisk -l

 

Disk /dev/sda: 12.8 GB, 12884901888 bytes

255 heads, 63 sectors/track, 1566 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 1566 12474472+ 8e Linux LVM

 

Disk /dev/sdb: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

Disk /dev/sdb doesn't contain a valid partition table

 

4. fdisk /dev/sdb” 파티션 설정

[root@sangchul ~]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

 

 

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

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)

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

 

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): p //설정 된 내용 확인

 

Disk /dev/sdb: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 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 //primary(확장) 설정

Partition number (1-4): 1 //파티션 번호 설정

First cylinder (1-2610, default 1): //엔터 (default 1 부터 설정)

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): //엔터 (default 2610 부터 설정)

Using default value 2610

 

Command (m for help): p //설정 된 내용 확인

 

Disk /dev/sdb: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

Device Boot Start End Blocks Id System

/dev/sdb1 1 2610 20964793+ 5 Extended

 

Command (m for help): w // 설정한 파티션 저정

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@sangchul ~]#

 

5. mkfs.ext3 /dev/sdb” 파일 시스템을 ext3 형식으로 생성

[root@sangchul ~]# mkfs.ext3 /dev/sdb1

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

2621440 inodes, 5241198 blocks

262059 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

160 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

 

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 39 mounts or

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

[root@sangchul ~]#

 

6. 마운트 지정 생성

[root@sangchul ~]# mkdir /data

 

7. 마운트

[root@sangchul ~]# mount -t ext3 /dev/sdb1 /data

 

8. 마운트 확인

[root@sangchul ~]# mount

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

/dev/sda1 on /boot type ext3 (rw)

tmpfs on /dev/shm type tmpfs (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

/dev/sdb1 on /data type ext3 (rw)

 

9. 자동 마운트(OS 시작 시 자동으로 마운트 하기)

[root@sangchul ~]# cat /etc/fstab

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

tmpfs /dev/shm tmpfs defaults 0 0

devpts /dev/pts devpts gid=5,mode=620 0 0

sysfs /sys sysfs defaults 0 0

proc /proc proc defaults 0 0

/dev/sdb1 /data ext3 defaults 1 2

/dev/VolGroup00/LogVol01 swap swap defaults 0 0

 

댓글
댓글쓰기 폼