rz上传文件失败-虚拟机存储100%-扩容挂载新虚拟盘

rz上传失败

rz安装

1
yum install lrzsz -y

弹出 zmodem transfer cancled by remote side 提示框
解决办法

1
2
3
4
5
6
df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_hadoop1-lv_root
6795192 5456592 986756 85% /
tmpfs 510036 0 510036 0% /dev/shm
/dev/sda1 487652 49447 412605 11% /boot
1
2
3
4
5
6
7
8
9
10
11
du -mx / |sort -rn |head -n 10
5314 /
2853 /bigdata
1172 /usr
733 /bigdata/hue-release-3.11.0
437 /tmp
407 /bigdata/hue-release-3.11.0/desktop
371 /bigdata/hue-release-3.11.0/desktop/core
363 /home
361 /bigdata/hadoop-2.6.5
331 /usr/share
1
2
3
4
5
6
7
8
9
10
11
du -mx /bigdata |sort -rn |head -n 10
2853 /bigdata
733 /bigdata/hue-release-3.11.0
407 /bigdata/hue-release-3.11.0/desktop
371 /bigdata/hue-release-3.11.0/desktop/core
361 /bigdata/hadoop-2.6.5
309 /bigdata/hadoop-2.6.5/share
298 /bigdata/jdk1.7.0_79
287 /bigdata/hue-release-3.11.0/desktop/core/ext-py
234 /bigdata/livy
218 /bigdata/hue-release-3.11.0/build

原因是虚拟机磁盘已满,85%是删除个别文件后的百分比,下面是扩展虚拟硬盘空间

VirtualBox-选中虚拟机【先关闭】-设置-存储-左边栏右下角添加SATA控制器-控制器:SATA最右边-创建新的虚拟盘(N)【如命名vd1.vdi】

image
image
image
image
image

格式化并挂载虚拟盘

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x0134d433.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044):
Using default value 1044

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sudo mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
524288 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
1
2
3
4
5
6
7
8
9
sudo mkdir work
sudo mount -t ext4 /dev/sdb1 /work
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_hadoop1-lv_root
6.5G 5.3G 964M 85% /
tmpfs 499M 0 499M 0% /dev/shm
/dev/sda1 477M 49M 403M 11% /boot
/dev/sdb1 7.8G 18M 7.4G 1% /work

开机自动挂载磁盘

如果虚拟机重启后挂载失效,需要重新挂载mount -t ext4 /dev/sdb1 /work
修改fstab分区表文件,vi /etc/fstab,末尾添加

1
/dev/sdb1               /work                   ext4    defaults        0 0
邵志鹏 wechat
扫一扫上面的二维码关注我的公众号
0%