(2)树莓派挂载外部硬盘

树莓派开机后挂载外部硬盘

Disk identifier: C86B6479-2681-49A4-813B-01E471FEC4CE A4T
Disk identifier: AE83D4B1-1061-4698-80C1-1AA9837D6E12 B4T

通常fdisk -l 查看硬盘

Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 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
Disklabel type: gpt
Disk identifier: C86B6479-2681-49A4-813B-01E471FEC4CE

Device      Start        End    Sectors  Size Type
/dev/sda1      34     262177     262144  128M Microsoft reserved
/dev/sda2  264192 7814035455 7813771264  3.7T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 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
Disklabel type: gpt
Disk identifier: AE83D4B1-1061-4698-80C1-1AA9837D6E12

Device      Start        End    Sectors  Size Type
/dev/sdb1      34     262177     262144  128M Microsoft reserved
/dev/sdb2  264192 7814035455 7813771264  3.7T Microsoft basic data

Partition 1 does not start on physical sector boundary.

可以查看到右2个硬盘每个硬盘有2个分区
但是挂载的时候回出现问题,应为是4T的硬盘

➜  ~ mount -t ntfs /dev/sda2 /mnt/A4T/
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

出现以上问题后通过以下命令查看具体问题, 可以查看 提示硬盘超过3T 太大不支持

  ~ dmesg |tail
[ 2812.520144] ntfs: (device sda2): parse_ntfs_boot_sector(): Volume size (3TiB) is too large for this architecture.  Maximum supported is 2TiB.  Sorry.
[ 2812.520157] ntfs: (device sda2): ntfs_fill_super(): Unsupported NTFS filesystem.

那么我们需要添加新的工具来让系统支持

sudo apt-get install ntfs-3g

安装好后可以正常挂载了, 也是费了一番功夫去查到

➜  ~ mount -t ntfs /dev/sdb2 /mnt/B4T
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.

自动挂载

每次手动挂载挺麻烦的.这时候需要进行自动挂载了
自动挂载涉及到文件/etc/fstab (file system table)和/etc/mtab

➜  /mnt cat /etc/fstab
# device       mount_point      filesystem   parameters   dump    fsck     
proc            /proc           proc    defaults          0       0
PARTUUID=dee441a9-01  /boot           vfat    defaults          0       2
PARTUUID=dee441a9-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

device 设备名或者卷标
mount point 需要被挂载的点
filesystem 文件系统类型 ext2, ext3, ntfs 等
parameters 文件系统参数,设置可读写等 默认defaults
dump 是否作为备份等操作 0 不备份 1 每天备份 默认0
fsck 是否检测扇区 0 不检测 1 检测 2 检测,但是比1检测时间晚

不够以防万一如果写错了 会开机到单用户模式,无法进行任何操作所有文件均为readonly状态
则需要重新挂载根目录

mount -n -o remount,rw /

转载于:https://www.cnblogs.com/Zidon/p/10188518.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值