I have a usb drive which I use for backup, and I had to grow a partition which is mounted on boot with its proper line in /etc/fstab.
Launching gparted, a first issue I had was that I coudn't umount the partition from gparted: trying to do it, I immediately found it mounted again, and gparted didn't permit me to do anything with that partition.
It seems to me that this behaviour happens only on usb drives, but I cannot understand why the hell gparted does it!
Anyway, umounting the partitions from a terminal, I got it unmounted, and apparently it stays unmounted, and I can tell gparted to grow it, and it begins growing it, but after a short time (20 seconds?) it stops saying:
Partition(s) 5 on /dev/sde have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
Saving the details, here they are:
GParted 0.25.0 --enable-libparted-dmraid --enable-online-resize
Libparted 3.2
Move /dev/sde5 to the left and grow it from 682.17 GiB to 931.51 GiB 00:01:57 ( ERROR )
calibrate /dev/sde5 00:00:00 ( SUCCESS )
path: /dev/sde5 (partition)
start: 522913792
end: 1953523711
size: 1430609920 (682.17 GiB)
check file system on /dev/sde5 for errors and (if possible) fix them 00:00:10 ( SUCCESS )
e2fsck -f -y -v -C 0 /dev/sde5 00:00:10 ( SUCCESS )
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
77300 inodes used (0.17%, out of 44711936)
1078 non-contiguous files (1.4%)
2 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 77291/1
105061981 blocks used (58.75%, out of 178826240)
0 bad blocks
1 large file
77256 regular files
35 directories
0 character device files
0 block device files
0 fifos
105 links
0 symbolic links (0 fast symbolic links)
0 sockets
------------
77396 files
e2fsck 1.42.13 (17-May-2015)
grow partition from 682.17 GiB to 931.51 GiB 00:00:00 ( SUCCESS )
old start: 522913792
old end: 1953523711
old size: 1430609920 (682.17 GiB)
new start: 4096
new end: 1953523711
new size: 1953519616 (931.51 GiB)
move file system to the left 00:00:00 ( ERROR )
e2image -ra -p -o 267729764352 /dev/sde5 00:00:00 ( ERROR )
e2image 1.42.13 (17-May-2015)
Running e2image on a R/W mounted filesystem can result in an
inconsistent image which will not be useful for debugging purposes.
Use -f option if you really want to do that.
rollback last change to the partition table 00:01:47 ( SUCCESS )
shrink partition from 931.51 GiB to 682.17 GiB 00:01:47 ( SUCCESS )
old start: 4096
old end: 1953523711
old size: 1953519616 (931.51 GiB)
new start: 522913792
new end: 1953523711
new size: 1430609920 (682.17 GiB)
check file system on /dev/sde5 for errors and (if possible) fix them 00:00:00 ( ERROR )
e2fsck -f -y -v -C 0 /dev/sde5 00:00:00 ( ERROR )
/dev/sde5 is mounted.
e2fsck 1.42.13 (17-May-2015)
e2fsck: Cannot continue, aborting.
libparted messages ( INFO )
Partition(s) 5 on /dev/sde have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
========================================
You can see that when e2image is run, it stops and complains that it's run on a r/w mounted file system. But - again - I didn't make anything in order to get it mounted.
The only way to have gparted growing my partition was continually unmounting the partition with the command
sudo watch -n 0.1 umount /dev/sde5
This way gparted is able to resize the partition.
My questions are:
- is actually gparted which mounts the partition????
- is there another way to get gparted resize the partition without the watch/umount command?
gparted. Have you tried toumountwhilegpartedwas not running? You may have a daemon (or so) that automounts removable devices. E.g. in KDE (Kubuntu) I have such an option in system settings. You may have not noticed that with the device in question because you use/etc/fstab. Just guessing. – Kamil Maciorowski Jan 05 '17 at 19:47