Ubuntu

在用 Ubuntu 20.10 替換 Windows 10 後嘗試規範化我的“D:”分區狀態

  • November 15, 2020

早上好,在用Ubuntu 20.10替換****Windows 10後,我正在嘗試規範化我的“D:”分區狀態……它顯示為Microsoft 基本數據,我無法觸摸該分區中的任何文件夾或文件(/dev/sda5 :權限被拒絕

例如:當我嘗試sudo rmdir “DumpStack.log.tmp”

rmdir:無法刪除“DumpStack.log.tmp”:只讀文件系統

我嘗試了以下方法(不起作用): https://askubuntu.com/a/1148959/1067284 https://askubuntu.com/a/809251/1067284

sudo ntfsfix /dev/sda5命令的結果:

Mounting volume... The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
FAILED
Attempting to correct errors... 
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sda5 was processed successfully.

sudo fdisk -l命令的結果:

Disk /dev/loop0: 97.74 MiB, 102486016 bytes, 200168 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


Disk /dev/loop1: 55.36 MiB, 58052608 bytes, 113384 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


Disk /dev/loop2: 62.09 MiB, 65105920 bytes, 127160 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


Disk /dev/loop3: 50.67 MiB, 53133312 bytes, 103776 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


Disk /dev/loop4: 55.32 MiB, 58007552 bytes, 113296 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


Disk /dev/loop5: 60.98 MiB, 63942656 bytes, 124888 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


Disk /dev/loop6: 217.89 MiB, 228478976 bytes, 446248 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


Disk /dev/loop7: 30.94 MiB, 32440320 bytes, 63360 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


Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500LT012-9WS14
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: FB9C0653-A6A2-4171-92BC-68CD5820A715

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    206847    204800   100M EFI System
/dev/sda2     206848    239615     32768    16M Microsoft reserved
/dev/sda3     239616 408274943 408035328 194.6G Linux filesystem
/dev/sda4  408274944 409597951   1323008   646M Windows recovery environment
/dev/sda5  409600000 976773119 567173120 270.4G Microsoft basic data


Disk /dev/loop8: 178.98 MiB, 187674624 bytes, 366552 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


Disk /dev/loop9: 169.3 MiB, 177528832 bytes, 346736 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


Disk /dev/loop10: 290.44 MiB, 304545792 bytes, 594816 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


Disk /dev/loop11: 125.85 MiB, 131960832 bytes, 257736 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


Disk /dev/loop12: 25.53 MiB, 26771456 bytes, 52288 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
  • 請注意,在 Ubuntu Install-Process 時我沒有刪除那些分區(Windows 恢復環境Microsoft 保留),因為我認為 Ubuntu 會替換它…

fdisk /dev/sda5命令的結果:

Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/sda5: Permission denied

sudo fdisk /dev/sda5命令的結果:

Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The device contains 'ntfs' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xdbf257c4.

Command (m for help): m

Help:

 DOS (MBR)
  a   toggle a bootable flag
  b   edit nested BSD disklabel
  c   toggle the dos compatibility flag

 Generic
  d   delete a partition
  F   list free unpartitioned space
  l   list known partition types
  n   add a new partition
  p   print the partition table
  t   change a partition type
  v   verify the partition table
  i   print information about a partition

 Misc
  m   print this menu
  u   change display/entry units
  x   extra functionality (experts only)

 Script
  I   load disk layout from sfdisk script file
  O   dump disk layout to sfdisk script file

 Save & Exit
  w   write table to disk and exit
  q   quit without saving changes

 Create a new label
  g   create a new empty GPT partition table
  G   create a new empty SGI (IRIX) partition table
  o   create a new empty DOS partition table
  s   create a new empty Sun partition table


Command (m for help): t
No partition is defined yet!

掛載結果| grep sda命令:

/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda5 on /media/johnm/301265D312659E9A type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)

請伙計們,我唯一想要的是將其更改回具有讀/寫權限的普通分區。我真的需要這個分區上的數據!

謝謝大家,我的一個朋友剛剛把這個很棒的方法丟給了我,它很有魅力:D

umount /dev/sda5
mkdir /sda5
mount /dev/sda5 /sda5
ls /sda5

並將以下行添加到**/etc/fstab**(要在 /sda5 文件夾中每次系統重新啟動後掛載分區) UUID={YOUR_UUID} /sda5 ntfs-3g defaults 0 0 請注意**{YOUR_UUID}必須替換為您從sudo blkid**命令獲得的分區的 UUID。

然後分區必須位於具有讀/寫權限的**/sda5**

引用自:https://unix.stackexchange.com/questions/619723