내 SDA에서 장치 속성 정보를 차단합니다.
sudo blkid
/dev/sda1: UUID="7E91-CA50" TYPE="vfat" PARTLABEL="win10" PARTUUID="b30fb21a-0b23-41fb-bed5-ad42ce287770"
/dev/sda2: UUID="6512f5f3-d574-49dd-a5ba-572795df8792" TYPE="ext4" PARTLABEL="debian" PARTUUID="eeca8d16-53cb-4b3e-9cb1-c335d34f8c22"
/dev/sda3: UUID="6434a352-35e0-46d9-b0a2-da724c91639f" TYPE="ext4" PARTLABEL="centos" PARTUUID="12f64023-b42e-48ce-a0d2-edb13625db9b"
/dev/sda4: UUID="0cba040e-d9da-4285-b70e-b2a9b5290a1c" TYPE="ext4" PARTLABEL="arch" PARTUUID="99e49e99-fdf2-4636-95b4-13dccde7dbca"
/dev/sda5: UUID="6a55c9fc-a1c6-4285-8763-093b9a715e4c" TYPE="swap" PARTLABEL="swap" PARTUUID="c4634793-b5e4-4c3a-abc8-a07dd0bd21fd"
uuid를 사용하여 /mongodb를 /dev/sda4에 마운트하고 싶습니다 0cba040e-d9da-4285-b70e-b2a9b5290a1c
.
내 /etc/fstab에 다음 줄을 추가했습니다.
UUID=0cba040e-d9da-4285-b70e-b2a9b5290a1c /mongodb ext4 rw,auto 0 1
다시 시작한 후 ls /mongodb로 이동합니다.
debian@wifi:~$ ls -alR /mongodb
/mongodb:
total 28
drwxr-xr-x 4 debian debian 4096 Aug 31 19:57 .
drwxr-xr-x 24 root root 4096 Aug 31 09:27 ..
drwxr-xr-x 2 debian debian 4096 Aug 31 19:57 log
drwx------ 2 root root 16384 Aug 31 09:25 lost+found
/mongodb/log:
total 8
drwxr-xr-x 2 debian debian 4096 Aug 31 19:57 .
drwxr-xr-x 4 debian debian 4096 Aug 31 19:57 ..
-rw-r--r-- 1 debian debian 0 Aug 31 19:57 mongodb.log
ls: cannot open directory /mongodb/lost+found: Permission denied
df -h /mongodb
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 46G 52M 44G 1% /mongodb
debian@wifi:~$ tree /mongodb
/mongodb
├── log
│ └── mongodb.log
└── lost+found [error opening dir]
2 directories, 1 file
debian@wifi:~$ sudo service mongo start
Failed to start mongo.service: Unit mongo.service failed to load: No such file or directory.
debian@wifi:~$ sudo service mongodb start
debian@wifi:~$ sudo service mongodb status
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled)
Active: failed (Result: exit-code) since Thu 2017-08-31 19:59:46 EDT; 2s ago
Docs: man:mongod(1)
Process: 1873 ExecStart=/usr/bin/mongod --config /etc/mongodb.conf (code=exited, status=1/FAILURE)
Main PID: 1873 (code=exited, status=1/FAILURE)
Aug 31 19:59:46 wifi mongod[1873]: all output going to: /mongodb/log/mongodb.log
Aug 31 19:59:46 wifi mongod[1873]: can't open [/mongodb/log/mongodb.log] for log file: errno:13 Permission denied
Aug 31 19:59:46 wifi mongod[1873]: Bad logpath value: "/mongodb/log/mongodb.log"; terminating.
Aug 31 19:59:46 wifi systemd[1]: mongodb.service: main process exited, code=exited, status=1/FAILURE
Aug 31 19:59:46 wifi systemd[1]: Unit mongodb.service entered failed state.
왜 mongodb를 시작할 수 없나요?
답변1
이미 말을 타고 있는 것 같습니다. loss+found는 FS 문제로 fsck를 시작할 때 검색된 파일이 발견된 EXT4 디렉토리입니다.
간단히 말해서 FS를 설치했습니다. 게시해 보세요:
df -h /mongodb