차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 | ||
tech:hdd_mount [2016/09/29 20:40] – ↷ 링크가 옮기기 작업으로 인해 적응했습니다 V_L | tech:hdd_mount [2024/04/15 23:11] (현재) – [고정 하드디스크 추가] V_L | ||
---|---|---|---|
줄 4: | 줄 4: | ||
그냥 꼽는다고 저절로 D: 이런식으로 추가되는 것은 아니다. 따로 설정을 해줘야 한다. | 그냥 꼽는다고 저절로 D: 이런식으로 추가되는 것은 아니다. 따로 설정을 해줘야 한다. | ||
- | =====고정 하드디스크 추가 | + | =====고정 하드디스크 추가===== |
일단 접속된 하드디스크들을 알아본다. | 일단 접속된 하드디스크들을 알아본다. | ||
sudo fdisk -l | sudo fdisk -l | ||
줄 14: | 줄 14: | ||
sudo nano /etc/fstab | sudo nano /etc/fstab | ||
- | 마지막 줄에 다음을 추가 ( sdb1 이 추가할 하드 디스크라고 가정) - /media/disk 디렉토리가 이미 만들어져 있어야 | + | 마지막 줄에 다음을 추가 ( sdb1 이 추가할 하드 디스크라고 가정) - /media/disk 디렉토리가 이미 만들어져 있어야 |
ext3 대신 fat32의 경우 vfat, ntfs의 경우 ntfs-3g | ext3 대신 fat32의 경우 vfat, ntfs의 경우 ntfs-3g | ||
줄 20: | 줄 20: | ||
/ | / | ||
- | + | ||
+ | / | ||
* umask=000 모든이에게 권한을 777로 주게 된다. | * umask=000 모든이에게 권한을 777로 주게 된다. | ||
* iocharset=cp949, | * iocharset=cp949, | ||
+ | |||
+ | /dev/sda 이런 것은 기기가 연결된 순서에 따라 바뀔 수 있다. 탈착이 자주 있는 경우는 UUID로 연결한다. | ||
+ | |||
+ | |||
+ | UUID=a9e6062b-2fe4-4e33-a28d-46f71dd9b243 /mnt/back ext4 defaults 0 0 | ||
+ | |||
+ | ==== UUID 확인==== | ||
+ | 디스크를 연결한 채로 blkid 를 실행 | ||
+ | |||
+ | blkid | grep '/ | ||
+ | /dev/sda1: UUID=" | ||
+ | |||
+ | |||
=====임시 연결 | =====임시 연결 | ||
줄 31: | 줄 45: | ||
sudo mkdir / | sudo mkdir / | ||
sudo mount -t vfat /dev/sdb1 / | sudo mount -t vfat /dev/sdb1 / | ||
- | sudo mount -t ntfs-3g | + | sudo mount -t ntfs3 /dev/sdb1 / |
+ | sudo mount -t ntfs3 --rw /dev/sdg1 / | ||
+ | | ||
sudo mount -w /dev/sdb1 /mnt/data -o umask=000, | sudo mount -w /dev/sdb1 /mnt/data -o umask=000, | ||
줄 42: | 줄 57: | ||
lrwxrwxrwx 1 root root 10 2011-12-12 23:23 7d35a2df-fe23-4618-98f9-495ba6409ad8 -> ../../sda5 | lrwxrwxrwx 1 root root 10 2011-12-12 23:23 7d35a2df-fe23-4618-98f9-495ba6409ad8 -> ../../sda5 | ||
)) | )) | ||
+ | |||
+ | ====NTFS==== | ||
+ | |||
+ | * ntfs - 왕거지. | ||
+ | * ntfs-3g - 거지. | ||
+ | * ntfs3 - 평민. 리눅스 커널 5.15 이후부터 지원됨. paragon | ||
+ | |||
=====ISO파일 마운트===== | =====ISO파일 마운트===== | ||
줄 54: | 줄 76: | ||
[[mount cifs]]참조 | [[mount cifs]]참조 | ||
+ | |||
+ | =====LVM mount===== | ||
+ | |||
+ | [[lvm mount]] 참조 | ||
=====기타===== | =====기타===== | ||
- | ① cat / | + | - |
- | ② fdisk /dev/hdb | + | |
- | * p로 기존 파티션 확인 | + | |
- | * d로 기존 파티션 삭제 | + | |
- | * n으로 파티션 추가 (p-> | + | |
- | * w로 쓴다 | + | |
- | ③ 포맷 | + | [[fdisk]]로 파티션 생성 |
- | ext4: mkfs.ext4 /dev/sda2 | + | fdisk /dev/hdb |
- | ext3: mke2fs -j / | + | |
- | ext2: mkfs -t ext2 /dev/hdb | + | * p로 기존 파티션 확인 |
- | ④ 마운트할 디렉토리 생성 (mkdir /new_dir) | + | * d로 기존 파티션 삭제 |
- | ⑤ 마운트 (mount -t ext3 /dev/hdb / | + | * n으로 파티션 추가 (p-> |
+ | * w로 쓴다 | ||
+ | |||
+ | - 포맷 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
sudo mount -t ntfs-3g /dev/sdb1 /mnt/data | sudo mount -t ntfs-3g /dev/sdb1 /mnt/data | ||
줄 131: | 줄 160: | ||
====== 새하드 포맷====== | ====== 새하드 포맷====== | ||
+ | [[fdisk]] 는 최대 2Tb 크기의 파티션을 지원한다. 그 이상의 파티션은 [[parted]]를 사용하면 된다. | ||
+ | |||
+ | fdisk /dev/sda | ||
Now to make a new partition. | Now to make a new partition. | ||
- | Press n < | + | |
- | This will make a new partition that uses the entire disk. If you want more complex partitioning then read the fdisk manual (man fdisk) or use parted or some other app. | + | |
- | Here's what we did with n, the values will differ from yours: | + | |
- | Code: | + | |
Command (m for help): n | Command (m for help): n | ||
Command action | Command action | ||
줄 146: | 줄 175: | ||
Using default value 197 | Using default value 197 | ||
Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): +128M | Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): +128M | ||
+ | |||
+ | Press n < | ||
+ | This will make a new partition that uses the entire disk. If you want more complex partitioning then read the fdisk manual (man fdisk) or use parted or some other app. | ||
+ | Here's what we did with n, the values will differ from yours: | ||
+ | |||
+ | |||
Now to write the new partion and exit, press w and enter. | Now to write the new partion and exit, press w and enter. | ||
줄 155: | 줄 190: | ||
So, let's make the filesystem: | So, let's make the filesystem: | ||
Code: | Code: | ||
+ | |||
sudo mkfs.ext3 /dev/sda1 | sudo mkfs.ext3 /dev/sda1 | ||
+ | |||
* Note the 1 at the end, because we are making the filesystem in that partition (thanks Mike) | * Note the 1 at the end, because we are making the filesystem in that partition (thanks Mike) | ||
줄 165: | 줄 202: | ||
If you cannot then you will need to mount it yourself, try: | If you cannot then you will need to mount it yourself, try: | ||
Code: | Code: | ||
+ | |||
sudo mkdir /media/sda1 | sudo mkdir /media/sda1 | ||
sudo mount /dev/sda1 /media/sda1 | sudo mount /dev/sda1 /media/sda1 | ||
+ | |||
Note: We are actually mounting the first partition on the drive, hence the 1 at the end: sda1 | Note: We are actually mounting the first partition on the drive, hence the 1 at the end: sda1 | ||
And the mounted directory can be anywhere you like, but its common location is /media. | And the mounted directory can be anywhere you like, but its common location is /media. |