[Ubuntu]12.04 hdd mount

1회용(리부팅시 초기화)

$ mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222

 

자동으로 마운트되는거

$ sudo blkid
/dev/sda1: UUID="5G70-AE7B" TYPE="vfat"
/dev/sda2: UUID="01n2ce86-fy3d-44f9-gja1-7601d64658f3" TYPE="ext4"
/dev/sda3: UUID="c3db3f8d-fgr3-4f6f-9nra-afgrgr5aad5e" TYPE="swap"
/dev/sdb1: UUID="46g447fc-aj4f-41a1-ab72-c70747asnfed" TYPE="ext4"

/dev/sdb1을 /datadir 마운트 하려는 경우

/etc/fstab을 열어서 맨 밑에 이렇게 넣어주면 끝.

UUID=46g447fc-aj4f-41a1-ab72-c70747asnfed /datadir   ext4    errors=remount-ro 0     1

 

참고
http://serverfault.com/questions/3132/how-do-i-find-the-uuid-of-a-filesystem

https://help.ubuntu.com/community/Fstab

 

GPT인 경우-

http://www.psychocats.net/ubuntu/mountlinux

GPT인 경우 오류가 좀 발생했던 것 같은데…
이 부분은 더 찾아봐야겠다.

 

밑에는 퍼온거.

http://kjhfull.tistory.com/entry/%EB%A6%AC%EB%88%85%EC%8A%A4-LVM-%EB%A7%88%EC%9A%B4%ED%8A%B8-%ED%95%98%EA%B8%B0
CentOS4.7이 디폴트로 설치된 하드를 백업받기 위해 새로운 시스템(centos5)에
꽂고 마운트 시켰는데 마운트가 안되는 현상이 있습니다.
원인은 LVM볼륨으로 작성되어서 그렇더군요!!
FDISK 상에서도 확인가능합니다.
====================================================================
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 2222 17743792+ 8e Linux LVM
=====================================================================
sdb1은 바로 마운트 가능하지만 LVM시스템은 마운트가 되지 않습니다.
아래 절차에 따라 하면 마운트 되네요…

pvdisplay /dev/sdb2 =>물리적 볼륨명 확인
— Physical volume —
PV Name /dev/sdb2
VG Name VolGroup00
PV Size 16.92 GB / not usable 15.92 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 541
Free PE 1
Allocated PE 540
PV UUID 3oTLIk-mvTW-50qN-BTop-i5yY-32A1-a8wlWY

vgchange -a y VolGroup00 /물리적 볼륨그룹 액티브 시키기
2 logical volume(s) in volume group “VolGroup00” now active

lvdisplay -v VolGroup00 /로지칼 볼륨 확인 (2개가 있다.)
Using logical volume(s) on command line
Fixing up missing size (16.92 GB) for PV /dev/sdb2
— Logical volume —
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID oFRCUd-Pzhp-L0YE-yLG1-Tgr8-SH38-lJ1ymJ
LV Write Access read/write
LV Status available
# open 0
LV Size 16.38 GB
Current LE 524
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0

— Logical volume —
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID hDDcZ3-WjMx-0OPq-W3Kk-W1ue-pN9b-5ngyIV
LV Write Access read/write
LV Status available
# open 0
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:1

mount -t ext3 /dev/VolGroup00/LogVol00 /sdb

하면 sdb2파티셔이 /sdb로 마운트가 된다.

centos 수동 마운트

# fdisk -l
# mkdir /filedir
# yum install ntfs-3g
# mount -t ntfs-3g /dev/sdb1 /filedir

인스톨 하려면 패키지가 필요하다.

centos 자동마운트
#gedit / etc / fstab

/dev/sda2 /windows ntfs defaults 0 0

centos마운트 설명
1. yum-priorities package install for rpmforge add to yum
[root@localhost ~]# yum install yum-priorities -y
2. “priority=N” add to /etc/yum/pluginconf.d/priorities.conf

[root@localhost ~]# vi /etc/yum/pluginconf.d/priorities.conf
[main]
enabled = 1
check_obsoletes = 1
priority=2

3. Install rpmforge

[root@localhost ~]# rpm -ivh http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

4. update yum

[root@localhost ~]# yum check-update

5. install “fuse”, “fuse-ntfs-3g”, “dkms”, “dkms-fuse”

[root@localhost ~]# yum install fuse fuse-ntfs-3g dkms dkms-fuse -y

6. make directory “windows” for mount ntfs

[root@localhost ~]# mkdir /windows

7. mount ntfs filesystem to “/windows” , type is ntfs-3g

[root@localhost ~]# mount -t ntfs-3g /dev/sda1 /windows

lvm mount 2번째
sudo apt-get install lvm2

sudo lvdisplay

나뉘어진 logical volume의 이름은 lvdisplay로 확인하였고,
volume group활성화 이후에 mount에 성공하였습니다.

volume group확인: pvdisplay /dev/hdd2
volume group활성화: vgchange -a y VolGroup00
logical volume확인: lvdisplay -v /dev/VolGroup00
logical volume mount: mount -t ext3 /dev/VolGroup00/LogVol00 /mnt/hdd