我使用 backuppc 将所有主机备份到可移动硬盘上,在 backuppc 的 $TOPDIR 属性中设置config.pl
/media/adam/Seagate-4TB/backuppc/
除我更换硬盘时外,硬盘始终处于连接状态。
问题是,虽然硬盘已连接,但它在启动时并未挂载。实际上,只有当我在 GUI 文件管理器或类似程序中单击驱动器时才会挂载。
May 21 13:27:10 gondor backuppc[1332]: 2017-05-21 13:27:10 Can't create a test hardlink between a file in
/media/adam/Seagate-4TB/backuppc/pc and /media/adam/Seagate-4TB/backuppc/cpool.
Either these are different file systems, or this file system doesn't
support hardlinks, or these directories don't exist, or there is a
permissions problem, or the file system is out of inodes or full.
Use df, df -i, and ls -ld to check each of these possibilities.
Quitting...
May 21 13:27:10 gondor systemd[1]: backuppc.service: Control process exited, code=exited status=1
May 21 13:27:10 gondor systemd[1]: Failed to start LSB: Launch backuppc server.
May 21 13:27:10 gondor systemd[1]: backuppc.service: Unit entered failed state.
May 21 13:27:10 gondor systemd[1]: backuppc.service: Failed with result 'exit-code'.
这一切都是可以预料到的,但我总是忘记安装驱动器并重新启动备份电脑。有时我会这样放上几个星期,然后才意识到备份没有运行 :(
我有什么选择?
我正在考虑编写一个启动脚本来在 backuppc 启动之前挂载可移动驱动器,但有没有更简单的选择?
更新
这些是我的硬盘,包括 Seagate 备份硬盘:
/dev/sdb1: UUID="f5e1afdc-69b4-4575-8fe4-d427dfc6874c" TYPE="ext4" PARTUUID="6e1a7899-01"
/dev/sdb5: UUID="b2fb1f65-b679-432f-9b0f-29ae8ef6aef0" TYPE="swap" PARTUUID="6e1a7899-05"
/dev/sda1: LABEL="Seagate-4TB" UUID="43d0ff42-f1f3-4101-ba50-1ddf68810440" TYPE="ext4" PARTLABEL="Seagate Backup Plus Drive" PARTUUID="522e4b98-09fa-40a9-8b21-4e204164f883"
/dev/sdd1: LABEL="WDPassport2T" UUID="cf125d89-87af-4dd1-9f17-8367c8e06bb1" TYPE="ext4" PARTUUID="83fb3c40-01"
/dev/sdc1: LABEL="Videos-2TB" UUID="28AA-C030" TYPE="exfat" PARTLABEL="primary" PARTUUID="d5261cee-ef5b-4039-bd63-e66334a47ea9"
答案1
启动时挂载磁盘的标准方法是在 /etc/fstab 中添加一个条目。
- 创建一个文件夹来挂载你的磁盘
sudo mkdir /mnt/Seagate-4TB
(或任何你想要的名字) - 通过运行查找磁盘的 UUID,
sudo blkid
输出将类似于:
/dev/sda2:UUID="32a4b76f-246e-486e-8495-31b8a781fb4c" TYPE="swap"
/dev/sda1:UUID="31f39d50-16fa-4248-b396-0cba7cd6eff2" 类型="ext4"
复制要挂载的磁盘的 UUID
- 然后编辑 /etc/fstab
sudo gedit /etc/fstab
并将你的条目添加到末尾
UUID=31f39d50-16fa-4248-b396-0cba7cd6eff2 /mnt/Seagate-4TB ext4 rw,用户,自动,nofail 0 0
当然,将 UUID 更改为您的实际磁盘 UUID。如果您使用的是其他文件系统,可能还需要更改 ext4。