Linux

하드디스크 추가

Jack Moon 2012. 10. 8. 16:28

1. 하드 디스크 장착 후 재부팅


2. 디스크 확인
# fdisk -l
Disk /dev/sdb doesn't contain a vaild partition tables


3. 파티션
# fdisk /dev/sdb



[root@mw ~]# fdisk -l


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          25      200781   83  Linux

/dev/sda2              26        6399    51199155   83  Linux

/dev/sda3            6400       12773    51199155   83  Linux

/dev/sda4           12774      121601   874160910    5  Extended

/dev/sda5           12774       19147    51199123+  83  Linux

/dev/sda6           19148       19669     4192933+  82  Linux swap / Solaris

/dev/sda7           19670       19930     2096451   83  Linux

/dev/sda8           19931      121601   816672276   83  Linux


Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


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

[root@mw ~]# 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 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)

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


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, 1000204886016 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.

Syncing disks.




4. 포맷
# mkfs.ext3 /dev/sdb1
( 만약 ext4 형식이면 mkfs.ext4 /dev/sdb1 )


5. 마운트
# mkdir /backup
# mount -t ext3 /dev/sdb1 /backup


6. /etc/fstab 에 등록
# vi /etc/fstab
LABEL=/1                /                       ext3    defaults        1 1
LABEL=/home1            /home                   ext3    defaults        1 2
LABEL=/tmp1             /tmp                    ext3    defaults        1 2
LABEL=/usr1             /usr                    ext3    defaults        1 2
LABEL=/var1             /var                    ext3    defaults        1 2
LABEL=/boot1            /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
LABEL=SWAP-sda6         swap                    swap    defaults        0 0
/dev/sdb1                /backup                 ext3    defaults        1 1


7. 재부팅 후 확인




---------------------------- 이하 과거내용

mount :

mount -t ext3 /dev/sda /disk01/

umount :

[root@node1 home]# umount /dev/hda9
umount: /home: device is busy
umount: /home: device is busy

[root@node1 /]# fuser -cu /home  
/home:               27150c(root)

[root@node1 /]# fuser -ck /home  
[root@node1 /]# umount /dev/hda9








'Linux' 카테고리의 다른 글

ffmpeg 설치 사용  (0) 2012.10.08
FFmpeg, ImageMagick, swfUpload  (0) 2012.10.08
프록시 서버 설정 (squid)  (0) 2012.10.08
심볼릭링크 & 하드링크  (0) 2012.10.08
스케쥴러 Cron At  (0) 2012.10.08