我一直在弄清楚这是否是(1)NixOS 问题,(2)Vultr 问题,(3)我的图像特有的问题。
我有一个运行自定义 Nix 映像 (18.09 Jellyfish) 的 Vultr VPS,控制台显示已分配的空间80G。
同时,df -h
向我展示了这一点:
[agam@nixos:~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 198M 0 198M 0% /dev
tmpfs 2.0G 4.0K 2.0G 1% /dev/shm
tmpfs 989M 3.0M 986M 1% /run
tmpfs 2.0G 456K 2.0G 1% /run/wrappers
tmpfs 2.0G 401M 1.6G 21% /
/dev/root 1.1G 1.1G 0 100% /iso
/dev/loop0 1.1G 1.1G 0 100% /nix/.ro-store
tmpfs 2.0G 2.0G 0 100% /nix/.rw-store
unionfs 3.0G 3.0G 0 100% /nix/store
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 396M 0 396M 0% /run/user/0
tmpfs 396M 0 396M 0% /run/user/1000
剩余的分配空间在哪里?
mount
显示:
[agam@nixos:~]$ mount
devtmpfs on /dev type devtmpfs (rw,nosuid,size=202364k,nr_inodes=504154,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=3,mode=620,ptmxmode=666)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=2023628k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=1011816k,mode=755)
ramfs on /run/keys type ramfs (rw,nosuid,nodev,relatime,mode=750)
tmpfs on /run/wrappers type tmpfs (rw,nodev,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on / type tmpfs (rw,relatime,mode=755)
/dev/sr0 on /iso type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048)
/iso/nix-store.squashfs on /nix/.ro-store type squashfs (ro,relatime)
tmpfs on /nix/.rw-store type tmpfs (rw,relatime,mode=755)
unionfs on /nix/store type fuse.unionfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
unionfs on /nix/store type fuse.unionfs (ro,relatime,user_id=0,group_id=0,default_permissions,allow_other)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=404724k,mode=700)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=404724k,mode=700,uid=1000,gid=100)
我想我只需要在 VPS 提供的存储上手动安装分区,然后以某种方式继续进行/
:
fdisk
显示:
Disk /dev/vda: 80 GiB, 85899345920 bytes, 167772160 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
答案1
感谢评论者,事实证明我曾是毕竟我太蠢了,我实际上忘记了安装NixOS 来自随附的 ISO (!)
之后fdisk /dev/vda
,在那里创建一个分区,设置/etc/nixos/configuration.nix
正确的方式,然后sudo nixos-install
,一切都应该是这样的。