AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[fdisk](ubuntu)

Martin Hope
Eric Steven
Asked: 2021-01-03 23:53:20 +0800 CST

fdisk 新磁盘大小

  • 3

我正在使用 ubuntu 20.04,我想创建正好 500 MB 的新分区磁盘。但是,fdisk 将其调整为 512MiB 有什么方法可以创建正好 500MB 的磁盘大小?

fdisk 输出

ric@Eric:~/Downloads$ sudo fdisk /dev/sda

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


Command (m for help): n
All primary partitions are in use.
Adding logical partition 7
First sector (2359260-10288994, default 2359260): 2359260
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2359260-10288994, default 10288994): +500M 

Created a new partition 7 of type 'Linux' and of size 512 MiB.

Command (m for help): p
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Portable SSD T5 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0xd13fa933

Device     Boot      Start        End   Sectors   Size Id Type
/dev/sda1  *    1952501760 1953523711   1021952   499M ef EFI (FAT-12/16/32)
/dev/sda2       1950453760 1952501759   2048000  1000M 83 Linux
/dev/sda3       1704693760 1950453759 245760000 117.2G 83 Linux
/dev/sda4            65536   10288994  10223459   4.9G  5 Extended
/dev/sda5           131071    1179629   1048559   512M 83 Linux
/dev/sda6          1245165    2293724   1048560   512M 83 Linux
/dev/sda7          2359260    3407819   1048560   512M 83 Linux

Partition table entries are not in disk order.

Command (m for help): 
fdisk
  • 1 个回答
  • 768 Views
Martin Hope
Toby Eggitt
Asked: 2020-09-23 08:58:46 +0800 CST

如何“fdisk -l”不包括快照

  • 0

在使用 dd 将可引导 ISO 写入 USB 驱动器之前,我想确定我拥有正确的设备。我的计划是在插入 USB 设备之前和之后使用 fdisk -l 列出所有设备。然后我简单地使用 diff 来查找附加的设备条目,我知道我在哪里。

但是现在, fdisk -l 为 snap 软件生成了大量的输出(单个记录分布在多行中)。当然,这与我的计划相冲突。

我可以让 fdisk -l 省略环回设备吗?我在手册页中搜索了“loop”和“snap”,但什么也没找到。

还有其他建议吗?

TIA

mount usb fdisk
  • 1 个回答
  • 88 Views
Martin Hope
Dan Green
Asked: 2020-04-19 07:06:25 +0800 CST

为什么不是所有程序都识别在启动时安装的某些驱动器?

  • 1

我的内部三星 970 EVO 500 GB 驱动器包含我的操作系统。我有两个包含文件的 Crucial 内部固态驱动器,并定义了符号链接,以便我可以从 ~/Documents 访问它们。我已经使用 Gnome Disks 设置了选项,以便在启动时安装这些驱动器。尽管如此,我注意到 Gnome Disks 并未将这些驱动器的条目放入/etc/fstab.

当我启动时,某些程序(例如用于将文件同步到 Google Drive 的 InSync)找不到 Crucial 驱动器。此外,当我在终端中查看符号链接时,它们会显示为存档文件。要激活符号链接,我必须导航到 Nautilus 中的驱动器。一旦我导航到 Nautilus 中的驱动器,符号链接就会在终端中实时显示,并且我的 InSync 等程序可以重新启动,并且可以轻松找到驱动器。

这里发生了什么?为什么 Gnome Disks 不更新/etc/fstab,如何让我的驱动器在启动时被识别?同样,为所有驱动器设置了 Gnome Disks 选项以检查启动时挂载。

fdisk gnome-disk-utility
  • 1 个回答
  • 126 Views
Martin Hope
Amin
Asked: 2020-01-10 05:17:02 +0800 CST

为什么我选择一个(fdisk)时删除了两个分区?

  • 1

我在 fdisk 中选择了一个要删除的分区,但是正如您看到的第三个交换分区也被删除了,为什么?

Device     Boot    Start      End  Sectors Size Id Type
/dev/sda1  *        2048 12584959 12582912   6G 83 Linux
/dev/sda2       12587006 20969471  8382466   4G  5 Extended
/dev/sda5       12587008 20969471  8382464   4G 82 Linux swap / Solaris

Command (m for help): d
Partition number (1,2,5, default 5): 2

Partition 2 has been deleted.

Command (m for help): p
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
Disklabel type: dos
Disk identifier: 0xd2dfe316

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *     2048 12584959 12582912   6G 83 Linux

Command (m for help):
partitioning fdisk
  • 2 个回答
  • 180 Views
Martin Hope
cabum is cool
Asked: 2019-12-31 18:44:41 +0800 CST

Nautilus 报告的空间量与 fdisk 不同

  • 2

我正在将一些文件保存到 USB 并告诉我我没有足够的可用空间,所以我删除了一些文件,但 Ubuntu 没有检测到空间释放。

我更改为我的 Windows 安装并进行了快速修复,它确实有效,但分区的大小减小了,但是当我将 USB 重新连接到我的 Linux 安装时,我收到的报告比 Windows 中的存储量更高。

我尝试运行fdisk,它确实检测到实际存储量,即 14.9 GiB,但nautilus检测到 16 GB,如下面的屏幕截图所示:

磁盘

鹦鹉螺

我该如何解决?

PS。USB 分区是sdb1.

nautilus fdisk
  • 1 个回答
  • 214 Views
Martin Hope
Karlom
Asked: 2019-12-12 02:52:29 +0800 CST

如何删除 /dev/loops [重复]

  • 8
这个问题在这里已经有了答案:
gnome-disk-utility 中可见的小型 snap loop 设备或 snap ubuntu-core 的功能是什么 3 个答案
2年前关闭。

在我的 Ubuntu 桌面上,该命令fdisk -l显示 /dev/loopX up to /dev/loop23. 我在 Ubuntu 18.04 LTS 上使用 gnome-fallback。

我想知道这些可能对操作系统的性能和稳定性产生什么影响,如果它们只是多余的,我该如何删除它们?

root@pc5:~# fdisk -l
...
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop15: 3.7 MiB, 3821568 bytes, 7464 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/loop16: 54.6 MiB, 57274368 bytes, 111864 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/loop17: 140.7 MiB, 147501056 bytes, 288088 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/loop18: 14.8 MiB, 15462400 bytes, 30200 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/loop19: 42.8 MiB, 44879872 bytes, 87656 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/loop20: 54.5 MiB, 57151488 bytes, 111624 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/loop21: 4.2 MiB, 4403200 bytes, 8600 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/loop22: 153.5 MiB, 160935936 bytes, 314328 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/loop23: 140.7 MiB, 147501056 bytes, 288088 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

输出df:

Filesystem      1K-blocks       Used  Available Use% Mounted on
udev              8128184          0    8128184   0% /dev
tmpfs             1630464       3716    1626748   1% /run
/dev/sda2       229184876   63255488  154217748  30% /
tmpfs             8152300     142672    8009628   2% /dev/shm
tmpfs                5120          4       5116   1% /run/lock
tmpfs             8152300          0    8152300   0% /sys/fs/cgroup
/dev/loop2         160512     160512          0 100% /snap/gnome-3-28-1804/110
/dev/loop3           4352       4352          0 100% /snap/gnome-calculator/544
/dev/loop0           3840       3840          0 100% /snap/gnome-system-monitor/111
/dev/loop4          91264      91264          0 100% /snap/core/8039
/dev/loop1           1024       1024          0 100% /snap/gnome-logs/81
/dev/loop6          87936      87936          0 100% /snap/shotcut/55
/dev/loop5         406528     406528          0 100% /snap/redis-desktop-manager/332
/dev/loop8          91264      91264          0 100% /snap/core/8213
/dev/loop7         406656     406656          0 100% /snap/redis-desktop-manager/335
/dev/loop9          15104      15104          0 100% /snap/gnome-characters/367
/dev/loop11        157184     157184          0 100% /snap/chromium/949
/dev/loop12         87808      87808          0 100% /snap/shotcut/53
/dev/loop13          1024       1024          0 100% /snap/gnome-logs/73
/dev/loop14         45312      45312          0 100% /snap/gtk-common-themes/1353
/dev/loop16         55936      55936          0 100% /snap/core18/1279
/dev/loop15          3840       3840          0 100% /snap/gnome-system-monitor/107
/dev/loop10        159872     159872          0 100% /snap/gnome-3-28-1804/91
/dev/loop17        144128     144128          0 100% /snap/gnome-3-26-1604/97
/dev/sda1          523248       6232     517016   2% /boot/efi
/dev/loop18         15104      15104          0 100% /snap/gnome-characters/359
/dev/loop19         43904      43904          0 100% /snap/gtk-common-themes/1313
/dev/loop20         55936      55936          0 100% /snap/core18/1265
/dev/loop21          4352       4352          0 100% /snap/gnome-calculator/536
/dev/loop22        157184     157184          0 100% /snap/chromium/958
/dev/loop23        144128     144128          0 100% /snap/gnome-3-26-1604/98
/dev/sdb1       492127240  409174612   57930932  88% /home
tmpfs             1630460         16    1630444   1% /run/user/121
tmpfs             1630460        140    1630320   1% /run/user/1001
tmpfs             1630460          0    1630460   0% /run/user/0
disk-management fdisk loop-device
  • 2 个回答
  • 30163 Views
Martin Hope
Mark W.
Asked: 2019-09-16 16:53:11 +0800 CST

硬盘分区:最佳传输大小

  • 4

我有一个西部数据 4TB 驱动器 (WD40PURZ)。看来,对驱动器进行分区的推荐过程导致:“最佳传输大小 33553920 字节不是物理块大小(4096 字节)的倍数”来自 linux 内核的警告。我应该担心吗?

partitioning fdisk parted
  • 1 个回答
  • 2211 Views
Martin Hope
asasa178
Asked: 2019-09-13 05:34:29 +0800 CST

fdisk 显示 /home 有 430GB 而 du -h 只有 326GB

  • 0

我的 /home 分区有 430GB,如 GParted 或 fdisk -l 所示。但是,如果我看

sudo du -h --max-depth=1 | sort -hr

磁盘中只有 326GB:

351G    .
326G    ./home
7.1G    ./var
6.4G    ./snap
6.2G    ./usr
2.2G    ./opt
848M    ./lib
196M    ./boot
16M ./etc
13M ./bin
12M ./sbin
3.7M    ./root

我看不到丢失的内存在哪里分配或消失了。任何帮助表示赞赏。

home-directory gparted disk-usage fdisk
  • 1 个回答
  • 26 Views
Martin Hope
Williams
Asked: 2019-06-20 03:01:01 +0800 CST

创建扩展分区,将整个 HDD 用于数据存储

  • 2

旧论坛帖子表明,假设您没有理由需要“主”分区,并且可以使您的整个磁盘成为“扩展”分区(尽管总是提到gparted不会这样做)。

我刚刚得到一个全新的空白 8TB 硬盘来转储一堆旧东西。我永远不会将它用作启动盘,所以我认为完全“扩展”对我来说是有意义的。

我已经尝试过:

  1. gparted: 我只有“Primary”这个选项,其他都是灰色的。
  2. fdisk:这非常令人困惑:它看起来不像这里介绍的简单,这可能来自更简单的时间。
  3. parted:mkpart问:

    分区名称?[]?

    这似乎导致了类似的路径fdisk。

这似乎是以前有人会问的问题,但在 2019 年的今天,工具似乎发生了变化,我找不到解决方案。

如何仅在使用 Ubuntu 18.10 的磁盘上创建 1 个分区和扩展分区???

partitioning gparted fdisk
  • 1 个回答
  • 69 Views
Martin Hope
oshirowanen
Asked: 2019-02-28 03:19:12 +0800 CST

使用 Ubuntu 的 LiveUSB 时看不到内部驱动器

  • 0

我有一台笔记本电脑,它有一个 256GB 的内部驱动器,上面安装了 Windows 10 企业版,它工作正常。

我想安装 Ubuntu 18.04.02。我已经创建了一个 LiveUSB,并且可以通过选择“尝试不安装”选项启动到操作系统。

但是,当我尝试安装 Ubuntu 时,我收到一条消息说我没有足够的存储空间。我试过sudo fdisk -l了,但它没有列出 256GB 驱动器。我也尝试过使用 gparted,它也没有列出 256GB 驱动器。

笔记本电脑是戴尔 Latitude 7490。

编辑1:

要关闭 Windows 10,我打开命令行并输入shutdown /s /f /t 0

sudo fdisk -l向我展示了以下内容:

在此处输入图像描述

sudo parted -l向我展示了以下内容:

在此处输入图像描述

live-usb ssd gparted fdisk 18.04
  • 1 个回答
  • 3059 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve