我当前的磁盘使用情况如下:
$:df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdd2 1.4T 13G 1.3T 1% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 30G 4.0K 30G 1% /dev
tmpfs 5.9G 1.9M 5.9G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 30G 152K 30G 1% /run/shm
none 100M 44K 100M 1% /run/user
/dev/sdd4 184G 159G 16G 92% /home
而且我的 /home 目录几乎已经满了,有什么方法可以利用 '/' 下的空间来增加我的 '/home' 目录吗?
谢谢
编辑:根据要求,我发布了 sudo parted -l 的输出:
fhwa@FHWA:~$ sudo parted -l
Model: ATA ST3500514NS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 500GB 500GB primary ntfs
Error: Invalid argument during seek for read on /dev/sdb
Retry/Ignore/Cancel? Retry
Error: Invalid argument during seek for read on /dev/sdb
Retry/Ignore/Cancel? I
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel?
OK/Cancel? O
Backtrace has 8 calls on stack:
8: /lib/x86_64-linux-gnu/libparted.so.0(ped_assert+0x31) [0x7fa918be54b1]
7: /lib/x86_64-linux-gnu/libparted.so.0(+0x3f5f6) [0x7fa918c155f6]
6: /lib/x86_64-linux-gnu/libparted.so.0(ped_disk_new+0x49) [0x7fa918beaf99]
5: parted() [0x406dff]
4: parted() [0x407bda]
3: parted(main+0x154b) [0x4065cb]
2: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fa9183c2ec5]
1: parted() [0x406617]
You found a bug in GNU Parted! Here's what you have to do:
Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:
Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:
http://ftp.gnu.org/gnu/parted/
Please check this version prior to bug reporting.
If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:
http://www.gnu.org/software/parted
for further information.
Your report should contain the version of this release (2.3)
along with the error message below, the output of
parted DEVICE unit co print unit s print
and the following history of commands you entered.
Also include any additional information about your setup you
consider important.
Assertion (last_usable <= disk->dev->length) at ../../../libparted/labels/gpt.c:994 in function _parse_header() failed.
答案1
虽然您可以调整分区大小,但这很繁琐(最终的错误可能会造成灾难性的后果),但您可以在主目录中创建实际存在的文件夹/
(通过链接或绑定挂载):
# First make directory in `/` to hold your data:
sudo mkdir -p /var/home-stuff
sudo chown $USER:$USER /var/home-stuff
然后创建一个链接:
ln -s /var/home-stuff ~/folder-in-root
或者将其绑定到你家里的文件夹:
mkdir -p ~/folder-in-root
sudo mount -o bind /var/home-stuff ~/folder-in-root
sudo chown $USER:$USER ~/folder-in-root
(您可以通过向 添加条目来使此绑定永久生效/etc/fstab
。)
现在放入的任何东西~/folder-in-root
实际上都会占据空间/
。