更新1

更新1

我有一台连接了外部磁盘的 Debian 8 服务器

$ sudo lsblk --fs
NAME    FSTYPE LABEL  UUID                                 MOUNTPOINT
sda     ext4          7169e849-0d6d-4094-b0f7-2daaeb1b1b00
vda
├─vda1  ext4   DOROOT 82446dcc-14f0-4e7f-ba53-4a256b379209 /
└─vda15

这是我的/etc/fstab

# 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>
# / was on /dev/sda2 during installation
LABEL=DOROOT    /               ext4    errors=remount-ro 0       1
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 /mnt/vol1 ext4 defaults,nofail,user,noauto 0 0
#/dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 /tmp ext4 defaults,nofail,user 0 0

我无法挂载/dev/sda磁盘

$ ls /dev/disk/by-id/
scsi-0DO_Volume_volume-sgp1-01
$ ls -l /dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01
lrwxrwxrwx 1 root root 9 May 27 23:31 /dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 -> ../../sda
$ sudo mount /dev/sda
mount: /dev/sda is already mounted or /mnt/vol1 busy
$ df -h -x tmpfs -x devtmpfs
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   21G  2.8G  89% /

由于某种原因,日志守护进程正在设备上运行sda

$ ps aux | grep sda
root       989  0.0  0.0      0     0 ?        S    23:31   0:00 [jbd2/sda-8]

如何才能成功挂载磁盘呢?

更新1

我无法安装或卸载磁盘

$ sudo mount -v /dev/sda    
mount: /dev/sda is already mounted or /mnt/vol1 busy    
$ sudo umount /dev/sda           
umount: /dev/sda: not mounted
$ sudo umount -f /dev/sda     
umount: /dev/sda: not mounted  

fdisk显示该设备确实是/dev/sda而不是/dev/sda1

$ sudo fdisk -l

Disk /dev/vda: 25 GiB, 26843545600 bytes, 52428800 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
Disklabel type: gpt
Disk identifier: 8B91C062-5A28-419D-9FBA-17F4EBA94861

Device     Start      End  Sectors Size Type
/dev/vda1   4096 52426751 52422656  25G Linux filesystem
/dev/vda15  2048     4095     2048   1M BIOS boot

Partition table entries are not in disk order.
Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 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

$ ls -l /dev/sda*
brw-rw---- 1 root disk 8, 0 May 27 23:31 /dev/sda
$

这是一个 DigitalOcean 虚拟专用服务器,并且/dev/sda是一个附加磁盘卷。

更新2

下面是磁盘分区的信息,说明确实是ext4。我之前已将此磁盘安装在从同一磁盘快照创建的另一个虚拟机上,并且能够读取和写入该磁盘。

$ sudo file -sL /dev/sd*
/dev/sdb: Linux rev 1.0 ext4 filesystem data, UUID=7169e849-0d6d-4094-b0f7-2daaeb1b1b00 (extents) (large files) (huge files)
$ sudo parted -l
Model: DO Volume (scsi)
Disk /dev/sdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  10.7GB  10.7GB  ext4

更新3

该错误mount: /dev/sda is already mounted or /mnt/vol1 busy是由于jbd2

$ ps aux|grep jbd
root       389  0.0  0.0      0     0 ?        S    23:30   0:00 [jbd2/vda1-8]
root      2171  0.0  0.0      0     0 ?        S    23:32   0:00 [jbd2/sda-8]

我的临时解决方案是注释掉设备/etc/fstab并重新启动。然后我可以手动挂载设备

LABEL=DOROOT    /               ext4    errors=remount-ro 0       1
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
#/dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 /mnt/vol1 ext4 defaults,nofail,user,noauto 0 0

为了缩小我的问题范围,我怎样才能jbd2“释放”磁盘设备以便我可以手动安装它?

相关内容