Ubuntu 编译 vmfs-tool

Ubuntu 编译 vmfs-tool

VMFS 文件系统想要在 linux 里读取,需要使用vmfs-fuse,但是这个工具已经下架了,所以需要自己编译,

其实编译整理来说就是缺什么下什么,然后就编译完了。

我的系统:ubuntu 20.04

vmfs-tools 下载地址

如果只做读取使用这个就可以了

下载下来后,直接安装即可

1
opkg -i vmfs-tools_0.2.5-1_amd64.deb

挂载 VMFS 文件系统

其实挂载VMFS 文件系统很简单,类似 mount 命令

1
2
3
4
5
# 查看哪个是 VMFS
fdisk -l
# 挂载 /dev/sdb3
mkdir /tmp/vmfs
vmfs-fuse /dev/sdb3 /tmp/vmfs

或者你也可以手动编译

安装需要的库

1
apt install git build-essential gcc pkg-config xsltproc libfuse-dev uuid-dev

下载源码编译

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 下载源码
cd /tmp
git clone https://github.com/glandium/vmfs-tools.git
cd vmfs-tools
# 开始编译
./configure
make
gcc -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -Ivmfs-fuse -Ilibvmfs -I/usr/include/uuid -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -c -o vmfs-fuse/vmfs-fuse.o vmfs-fuse/vmfs-fuse.c
gcc -o vmfs-fuse/vmfs-fuse vmfs-fuse/vmfs-fuse.o libvmfs/libvmfs.a -luuid -lfuse -pthread
# 安装
make install
install -s -m 0755 debugvmfs/debugvmfs /usr/local/sbin/
install -s -m 0755 vmfs-lvm/vmfs-lvm /usr/local/sbin/
install -s -m 0755 vmfs-fuse/vmfs-fuse /usr/local/sbin/
install -s -m 0755 fsck.vmfs/fsck.vmfs /usr/local/sbin/

从 nextcloud URI 中移除 index.php

从 nextcloud URI 中移除 index.php

仅限 Apache

  1. 编辑 nextcloud 配置文件,增加'htaccess.RewriteBase' => '/',

    1
    nano /var/www/nextcloud/config/config.php
  2. 使用 occ 命令更新.htaccess文件

    1
    2
    occ maintenance:update:htaccess
    # .htaccess has been updated
  3. 完成,刷新网页看效果

安装 Cloudreve

NAS

安装 Cloudreve

ubuntu 18.04

docker 那个版本总是有问题就算了 (2019/04/16)

之所以要安装是因为长得好看

安装

1
2
# 安装必备内容
apt install mysql-server apache2 php php-curl php-gd php-dom php-mbstring php-zip php-mysql php-mysqli -y

mysql 创建数据库

1
CREATE DATABASE cloudreve CHARACTER SET utf8 COLLATE utf8_general_ci;

安装 composer

1
2
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

安装 cloudreve

1
2
cd 你要安装的目录
composer create-project hfo4/cloudreve:dev-master

交互环节

1
2
3
4
5
6
7
8
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? # Y
Input the hostname of your MySQL server (Default:127.0.0.1): //数据库连接地址,本的话默认回车
The database name:pan //数据库名称
The username of your MySQL server (Default:root):root //数据库用户名
The password of your MySQL server:mf8.biz //数据库用户密码
The hostport of your MySQL server (Default:3306): //数据库端口,默认回车

The full-url to access to your Cloudreve (e.g. https://pan.aoaoao.me/ , 'http' must be included in the front and '/' must be included at the end): //网站域名, 必须 http:// 或者 https:// 开头, / 结尾

安装完毕

1
2
3
4
5
6
# Congratulations! Cloudreve has been installed successfully.
# Here's some informatioin about yor Cloudreve:
# Homepage: 刚才输入的地址/ //首页地址
# Admin Panel: 刚才输入的地址/Admin //后台地址
# Default username: admin@cloudreve.org //管理员账号
# Default password: admin //管理员密码

备注

  • 如果可以打开首页但是其他页面都无法访问,记得开启 apache2 伪静态

    1
    2
    3
    4
    sudo a2enmod rewrite
    sudo service apache2 restart
    # 替换 AllowOverride None -> AllowOverride All
    sudo nano /etc/apache2/apache2.conf

保存 Git 认证信息

保存 Git 认证信息

如果经常 git pull 而且总是要输入密码信息一定很麻烦

代码

1
2
3
4
5
cd codedir # 跳转到代码目录,确保其中有 .git 文件夹
git config credential.helper store # 开启密码保存功能
git pull # 输入认证信息
git pull # 验证是否需要输入认证信息
# 结束

修复 the following signatures couldn’t be verified because the public key is not available 错误

修复 public key is not available

the following signatures couldn’t be verified because the public key is not available

错误提示:

例如:

1
2
3
Err:6 https://dl.yarnpkg.com/debian stable InRelease

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E

解决办法:

1
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 23E7166788B63E1E

PUBKEY 要一致,例如上文中的:23E7166788B63E1E