우분투 14.04 시작 시 모든 사용자를 위한 외장 하드 디스크 마운트

우분투 14.04 시작 시 모든 사용자를 위한 외장 하드 디스크 마운트

안녕하세요 저는 Ubuntu를 처음 접했고 최근에 14.04 LTS를 설치했습니다. 시작 시 모든 사용자가 외장 하드 드라이브를 장착하는 데 문제가 있습니다. 예를 들어, 시작한 후 사용자 A로 로그인하면 사용자 A만 외부 미디어에 액세스할 수 있고 다른 사용자는 이러한 외부 미디어에 액세스할 수 없습니다. 누군가 이 문제를 해결하도록 도와주실 수 있나요?

다음 명령으로 출력

sudo blkid

/dev/sda1: UUID="98715d8d-bf13-48f5-882e-36270c539c94" TYPE="ext4" 
/dev/sda2: UUID="qOUDEc-qHDq-y9NL-OWCF-fO04-vnPI-8UNrtV" TYPE="LVM2_member" 
/dev/sdb1: UUID="6ulNAl-1Hky-orpE-ntL2-Brgu-Qen1-BYqCIh" TYPE="LVM2_member" 
/dev/mapper/VolGroup-lv_root: UUID="a7e84558-d5d3-43f3-8788-a483dde96fd8" TYPE="ext4" 
/dev/mapper/VolGroup-lv_home: UUID="fb65cc75-ab1a-44a4-8f98-b1767d03f15a" TYPE="ext4" 
/dev/mapper/VolGroup-lv_swap: UUID="69e3381b-a2b5-4866-81b6-bd368c9157d5" TYPE="swap" 
/dev/sdc1: LABEL="ExtHDD04" UUID="0DFFA1CB15212E12" TYPE="ntfs" 
/dev/sdd1: LABEL="ExtHDD03" UUID="485AA7713243CEFB" TYPE="ntfs" 
/dev/sde1: UUID="485ef4bd-0093-42c5-a3e5-0090e68e93c1" TYPE="ext4" 
/dev/sr1: LABEL="WD SmartWare" TYPE="udf" 
/dev/sdg1: LABEL="ExtHDD01" UUID="00148BDE148BD4D6" TYPE="ntfs" 

sudo fdisk -l

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc648a420

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   488280063   243627008   8e  Linux LVM

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000617c8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907028991  1953513472   8e  Linux LVM

Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup-lv_root doesn't contain a valid partition table

Disk /dev/mapper/VolGroup-lv_home: 2168.7 GB, 2168656494592 bytes
255 heads, 63 sectors/track, 263657 cylinders, total 4235657216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup-lv_home doesn't contain a valid partition table

Disk /dev/mapper/VolGroup-lv_swap: 27.5 GB, 27481079808 bytes
255 heads, 63 sectors/track, 3341 cylinders, total 53673984 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup-lv_swap doesn't contain a valid partition table

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 3000.6 GB, 3000558944256 bytes
255 heads, 63 sectors/track, 364797 cylinders, total 5860466688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdd: 3000.6 GB, 3000558944256 bytes
255 heads, 63 sectors/track, 364797 cylinders, total 5860466688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sde: 3000.6 GB, 3000558944256 bytes
255 heads, 63 sectors/track, 364797 cylinders, total 5860466688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdg: 1999.7 GB, 1999696297984 bytes
228 heads, 56 sectors/track, 305894 cylinders, total 3905656832 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe534f55f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1            2048  3905656831  1952827392    7  HPFS/NTFS/exFAT

고양이 /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/VolGroup-lv_root /               ext4    errors=remount-ro 0       1
/dev/mapper/VolGroup-lv_home /home           ext4    defaults        0       2
/dev/mapper/VolGroup-lv_swap none            swap    sw              0       0

답변1

모든 사용자에 대해 시작 시 파티션을 마운트하려면 파일에 항목이 필요합니다 fstab. 현재 일어나고 있는 일은 로그인한 사용자를 위해 HDD가 마운트되어 해당 사용자에게만 액세스 권한을 부여하는 것입니다. fstab에 항목을 추가하면 모든 사용자가 액세스할 수 있는 루트로 파티션이 마운트됩니다. 이 r/w 액세스는 나중에 제어할 수 있습니다.

sudo blkid시스템에서 사용 가능한 모든 파티션을 나열합니다. UUID부팅 시 마운트할 NTFS 파티션을 기록해 두세요 . 귀하의 경우에는00148BDE148BD4D6

이제 예를 들어 폴더를 만듭니다 sudo mkdir /media/ExtHDD01. 이것은 외장 HDD 파티션이 마운트될 폴더입니다. 이 폴더는 루트가 소유하게 됩니다. 다른 사용자에게 이 폴더에 대한 읽기/쓰기 권한을 부여하려면 적절한 권한을 부여해야 합니다. 그렇다면 chmod -R 777 /media/ExtHDD01충분할 것입니다. 이제 fstab 파일을 편집해야 합니다. 그렇게 하려면 다음 명령을 입력하십시오.

sudo nano /etc/fstab

파일 맨 아래로 이동하여 거기에 다음 줄을 추가하십시오.

UUID=00148BDE148BD4D6 /media/ExtHDD01/    ntfs-3g        auto,user,rw 0 0

시스템을 재부팅하면 됩니다. HDD 수에 관계없이 동일한 절차를 따를 수 있습니다.

답변2

GUI 방식

  1. 드라이브를 연결하십시오.

  2. Disks데스크탑 파인더(또는 sudo gnome-disks터미널) 로 이동하세요 .

  3. 왼쪽 열에서 올바른 디스크를 선택하십시오.

  4. 톱니바퀴 아이콘을 클릭하세요.여기에 이미지 설명을 입력하세요

  5. 선택하다edit mount options

  6. 회전하다off

  7. 둘 다 확인 mount at startup하고show user interface

그게 다야!

답변3

저도 최근에 같은 상황이었는데 해결방법을 찾았습니다.

ADMIN과 DESKTOP USER라는 2명의 사용자가 있는데 각각의 로그인 시 STORAGE라는 라벨이 붙은 동일한 드라이브를 마운트하려고 합니다.

파일에 /etc/fstab다음 항목을 추가해야 했습니다.

LABEL=STORAGE /media/$USER/STORAGE auto nosuid,nodev,nofail,x-gvfs-show 0 0

주목할 만한 점은 환경 변수를 사용한다는 점이다 $USER.

이는 새 드라이브가 마운트되는 Ubuntu 16.04용입니다./media/<username>/<drive-label>

. 대신 UUID를 사용할 수도 있습니다 <drive-label>.

관련 정보