WDMyCloud:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 1968336 482148 1386200 26% /
/dev/root 1968336 482148 1386200 26% /
tmpfs 23056 336 22720 2% /run
tmpfs 40960 4 40956 1% /run/lock
tmpfs 10240 0 10240 0% /dev
tmpfs 5120 0 5120 0% /run/shm
tmpfs 102400 196 102204 1% /tmp
/dev/root 1968336 482148 1386200 26% /var/log.hdd
ramlog-tmpfs 20480 1988 18492 10% /var/log
/dev/sda4 2879644604 594272 2820539292 1% /DataVolume
/dev/root 1968336 482148 1386200 26% /nfs/Public
/dev/root 1968336 482148 1386200 26% /nfs/SmartWare
/dev/root 1968336 482148 1386200 26% /nfs/TimeMachineBackup
WDMyCloud:~# umount /dev/sda4
WDMyCloud:~# umount /dev/root
WDMyCloud:~# umount /dev/root
WDMyCloud:~# umount /dev/root
WDMyCloud:~# umount /dev/root
WDMyCloud:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 1968336 482148 1386200 26% /
/dev/root 1968336 482148 1386200 26% /
tmpfs 23056 336 22720 2% /run
tmpfs 40960 4 40956 1% /run/lock
tmpfs 10240 0 10240 0% /dev
tmpfs 5120 0 5120 0% /run/shm
tmpfs 102400 196 102204 1% /tmp
ramlog-tmpfs 20480 1988 18492 10% /var/log
WDMyCloud:~# e2fsck /dev/sda4
e2fsck 1.42.5 (29-Jul-2012)
/dev/sda4 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Journal inode is not in use, but contains data. Clear<y>? yes
Pass 2: Checking directory structure
Entry 'cache' in / (2) has deleted/unused inode 92798977. Clear<y>? yes
Entry 'shares' in / (2) has deleted/unused inode 51642369. Clear<y>? yes
Entry 'backup' in / (2) has deleted/unused inode 28049409. Clear<y>? yes
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 2 ref count is 6, should be 3. Fix<y>? yes
Pass 5: Checking group summary information
Block bitmap differences: -(33808--33814) -(34304--64646) -(65536--98303) -(100352--163839) -(165888--229375) -(231424--294911) -(296960--524287) -(57679904--57679911) -(68165664--68165676) -(68165680--68165687) -518004768
Fix<y>? yes
Free blocks count wrong for group #1 (1393, counted=31743).
Fix<y>? yes
Free blocks count wrong for group #2 (0, counted=32768).
Fix<y>? yes
Free blocks count wrong for group #3 (1023, counted=31743).
Fix<y>? yes
Free blocks count wrong for group #4 (29696, counted=32768).
Fix<y>? yes
Free blocks count wrong for group #3424 (24543, counted=24544).
Fix<y>? yes
Free blocks count wrong for group #6304 (24526, counted=24544).
Fix<y>? yes
Free blocks count wrong for group #6305 (32754, counted=32768).
Fix<y>? yes
Free blocks count wrong for group #7425 (0, counted=32768).
Fix<y>? yes
Free blocks count wrong for group #11328 (24513, counted=24544).
Fix<y>? yes
Free blocks count wrong for group #11329 (32626, counted=32768).
Fix<y>? yes
Free blocks count wrong (719762583, counted=719892467).
Fix<y>? yes
Free inodes count wrong for group #3424 (8191, counted=8192).
Fix<y>? yes
Directories count wrong for group #3424 (1, counted=0).
Fix<y>? yes
Free inodes count wrong for group #6304 (8174, counted=8192).
Fix<y>? yes
Directories count wrong for group #6304 (15, counted=0).
Fix<y>? yes
Free inodes count wrong for group #11328 (8084, counted=8192).
Fix<y>? yes
Directories count wrong for group #11328 (31, counted=0).
Fix<y>? yes
Free inodes count wrong (182853494, counted=182853621).
Fix<y>? yes
/dev/sda4: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda4: 11/182853632 files (0.0% non-contiguous), 11495550/731388017 blocks
WDMyCloud:~# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? OK
Warning: Not all of the space available to /dev/sda appears to be used, you can
fix the GPT to use all of the space (an extra 1953504000 blocks) or continue
with the current setting?
Fix/Ignore? Fix
Model: ATA WDC WD40EFRX-68W (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
3 15.7MB 528MB 513MB linux-swap(v1) primary
1 528MB 2576MB 2048MB ext3 primary raid
2 2576MB 4624MB 2048MB ext3 primary raid
5 4624MB 4724MB 99.6MB primary
6 4724MB 4824MB 101MB primary
7 4824MB 4826MB 1049kB primary
8 4826MB 4828MB 2097kB primary
4 4828MB 3001GB 2996GB ext4 primary
(parted) unit
Unit? [compact]? s
(parted) p
Model: ATA WDC WD40EFRX-68W (scsi)
Disk /dev/sda: 7814037168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
3 30720s 1032191s 1001472s linux-swap(v1) primary
1 1032192s 5031935s 3999744s ext3 primary raid
2 5031936s 9031679s 3999744s ext3 primary raid
5 9031680s 9226239s 194560s primary
6 9226240s 9422847s 196608s primary
7 9422848s 9424895s 2048s primary
8 9424896s 9428991s 4096s primary
4 9428992s 5860533134s 5851104143s ext4 primary
(parted) rm 4
(parted) mkpart
Partition name? []?
File system type? [ext2]? ext4
Start? 9428992s # 开始扇区的是原来4号分区的开始扇区
End? 7814037167s # 终止扇区的是执行 p 命令时候返回的磁盘总扇区数7814037168s-1
(parted) q
Information: You may need to update /etc/fstab.
WDMyCloud:~# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA WDC WD40EFRX-68W (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
3 15.7MB 528MB 513MB linux-swap(v1) primary
1 528MB 2576MB 2048MB ext3 primary raid
2 2576MB 4624MB 2048MB ext3 primary raid
5 4624MB 4724MB 99.6MB primary
6 4724MB 4824MB 101MB primary
7 4824MB 4826MB 1049kB primary
8 4826MB 4828MB 2097kB primary
4 4828MB 3996GB 3991GB ext4
(parted) check 4
WARNING: you are attempting to use parted to operate on (check) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Warning: Partition 4 is 3991GB, but the file system is 2996GB.
Ignore/Cancel? Ignore
Error: File system has an incompatible feature enabled. Compatible features are
has_journal, dir_index, filetype, sparse_super and large_file. Use tune2fs or
debugfs to remove features.
(parted) q
WDMyCloud:~# resize2fs /dev/sda4
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sda4 to 974397394 (4k) blocks.
The filesystem on /dev/sda4 is now 974397394 blocks long.
WDMyCloud:~# reboot