변군이글루

[리눅스] 하드 디스크 증설 본문

서___리눅스

[리눅스] 하드 디스크 증설

변군 변군이글루 2013.09.01 22:27

하드 디스크 증설

 

[root@i55033 ~]# fdisk -l

 

Disk /dev/sda: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 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        1318    10482412+  83  Linux
/dev/sda3            1319        1579     2096482+  82  Linux swap
/dev/sda4            1580       17849   130688775    5  Extended
/dev/sda5            1580       17849   130688743+  83  Linux

 

// 하드(HDD)디스크 장착
// 장착 후 리부팅

 

[root@i55033 ~]# fdisk -l

 

Disk /dev/sda: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 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        1318    10482412+  83  Linux
/dev/sda3            1319        1579     2096482+  82  Linux swap
/dev/sda4            1580       17849   130688775    5  Extended
/dev/sda5            1580       17849   130688743+  83  Linux

 

Disk /dev/sdb: 146.8 GB, 146814976000 bytes <= 추가 된 /dev/sdb
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

 

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

 

[root@i55033 ~]# fdisk /dev/sdb <= fdisk 장착한 하드디스크에 파티션 할당

 

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 17849.
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: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System // 현재 생성 된 Partition table 없다

Command (m for help): n <= 새로운 파티션 분할
Command action
e extended
p primary partition (1-4)
p <= primary partition 선택
Partition number (1-4): 1 <= partition 1 번호 선택(최대 4개 까지 생성 가능)

 

First cylinder (1-17849, default 1): 1 <= 시작 실린더 번호 입력
Last cylinder or +size or +sizeM or +sizeK (1-17849, default 17849): 17849 <= 마지막 실린더 번호 입력

 

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

 

Disk /dev/sdb: 146.8 GB, 146814976000 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       17849   143372061   83  Linux

 

Command (m for help): w <= 설정 저장
The partition table has been altered!

 

Calling ioctl() to re-read partition table.
Syncing disks.

[root@i55033 ~]# mkfs.ext3 /dev/sdb1 <= 파일시스템을 ext3 형식으로 생성
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
17924096 inodes, 35843015 blocks
1792150 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=37748736
1094 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

 

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.


[root@i55033 ~]# ls /
bin   dev  home   initrd  lost+found  misc  opt   root  selinux  sys       tmp  var
boot  etc  home1  lib     media       mnt   proc  sbin  srv      tftpboot  usr

 

[root@i55033 ~]# mkdir /home2

 

[root@i55033 ~]# mount -t ext3 /dev/sdb1 /home2/

 

[root@i55033 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.9G  1.8G  7.6G  20% /
/dev/sda1              99M   12M   83M  12% /boot
none                  2.0G     0  2.0G   0% /dev/shm
/dev/sda5             123G   93M  117G   1% /home1
/dev/sdb1             135G   93M  128G   1% /home2

 

[root@i55033 ~]# vi /etc/fstab

 

LABEL=/                       /                       ext3      defaults               1 1
LABEL=/boot1               /boot                ext3      defaults               1 2
none                             /dev/pts           devpts  gid=5,mode=620  0 0
none                             /dev/shm         tmpfs    defaults               0 0
LABEL=/home1              /home1            ext3      defaults               1 2
none                              /proc               proc     defaults               0 0
none                              /sys                 sysfs   defaults               0 0
LABEL=SWAP-sda3        swap               swap   defaults               0 0
/dev/sdb1                      /home2            ext3     defaults               1 1 <= 테이블 추가

~
~
"/etc/fstab" 9L, 646C written


[root@i55033 ~]#

[root@i55033 ~]# cat /etc/fstab
LABEL=/                         /                            ext3       defaults               1 1
LABEL=/boot1                /boot                      ext3       defaults              1 2
none                              /dev/pts                 devpts  gid=5,mode=620  0 0
none                              /dev/shm               tmpfs    defaults               0 0
LABEL=/home1               /home1                  ext3      defaults              1 2
none                               /proc                     proc     defaults              0 0
none                               /sys                      sysfs    defaults               0 0
LABEL=SWAP-sda3         swap                    swap    defaults               0 0
/dev/sdb1                      /home2                  ext3      defaults               1 1

[root@i55033 ~]#

 

 

 

'서___리눅스' 카테고리의 다른 글

[리눅스] fstab의 필드 구성  (0) 2013.09.01
[리눅스] kickstart  (0) 2013.09.01
[리눅스] 하드 디스크 증설  (0) 2013.09.01
[리눅스] traceroute 명령어  (2) 2013.09.01
[리눅스] 부트로더 복구(싱글모드)  (0) 2013.09.01
[리눅스] alias 명령어  (3) 2013.09.01
0 Comments
댓글쓰기 폼