본문 바로가기

Linux

ubuntu fdisk

fdisk로 파티션 정보를 본다.

[code]
[root@localhost root]# fdisk -l
[/code]

Disk /dev/sda: 18.2 GB, 18210037760 bytes
64 heads, 32 sectors/track, 17366 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot    Start     End    Blocks Id System
/dev/sda1 *         1     100    102384 83 Linux
/dev/sda2         101     1124 1048576 82 Linux swap
/dev/sda3         1125     17366 16631808 83 Linux

Disk /dev/sdb: 18.2 GB, 18210037760 bytes
64 heads, 32 sectors/track, 17366 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

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


여기서는 sdb로 잡힐 것이므로 다음과 같이 입력한다.

[code]
[root@localhost root]# fdisk /dev/sdb
[/code]
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 17366.
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: 18.2 GB, 18210037760 bytes
64 heads, 32 sectors/track, 17366 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot    Start     End    Blocks Id System


새로 파티션을 추가한다.
[code]
Command (m for help): n
[/code]
Command action
e extended
p primary partition (1-4)

확장
e


확장 파티션의 1번 파티션
[code]
Partition number (1-4): 1
[/code]

실린더의 크기는 디폴트로
[code]
First cylinder (1-17366, default 1): 1
[/code]

역시 마지막 실린더의 크기도 디폴트로 잡는다.
[code]
Last cylinder or +size or +sizeM or +sizeK (1-17366, default 17366): 17366
[/code]

파티션이 나뉘어져 있는지 확인해본다.
[code]
Command (m for help): p
[/code]
Disk /dev/sdb: 18.2 GB, 18210037760 bytes
64 heads, 32 sectors/track, 17366 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot    Start     End    Blocks Id System
/dev/sdb1             1     17366 17782768    5 Extended


파티션 테이블을 쓴다.
[code]
Command (m for help): w
[/code]
The partition table has been altered!

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


파일포멧을 지정하여 sdb로 잡는다.
[code]
[root@localhost root]# mkfs -t ext3 /dev/sdb
[/code]
mke2fs 1.32 (09-Nov-2002)
/dev/sdb is entire device, not just one partition!


어느곳에서 진행하겠냐는 말이다. 그냥 yes한다.
[code]
Proceed anyway? (y,n) y
[/code]
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2223872 inodes, 4445810 blocks
222290 blocks (5.00%) reserved for the super user
First data block=0
136 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

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

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


마운트할 디렉토리를 생성해준다.
[code]
[root@localhost root]# mkdir /home/jsbae/data
[/code]

마운트한다.
[code]
[root@localhost root]# mount /dev/sdb /home/jsbae/data/
[/code]

마운트가 되었는지 확인해본다.
[code]
[root@localhost root]# mount
[/code]
/dev/sda3 on / type ext3 (rw)
none on /proc type proc (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/sdb on /home/jsbae/data type ext3 (rw)


[root@localhost root]#

'Linux' 카테고리의 다른 글

ubuntu samba  (0) 2013.09.26
auto mount  (0) 2013.09.26
ubuntu eclipse install  (0) 2013.09.26
ubuntu jdk install  (0) 2013.09.26
ubuntu jdk install  (0) 2013.09.26