HomSpace Forum

Full Version: Error When Trying to Resize Samples Partition
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Folks,

Thanks so much to Hans for this distro, and for keeping the SamplerBox project alive. I just discovered it in the last week and it seems great.

I have the latest image (Box20210521.img) running on an SD card on a Raspberry Pi Model B (I hadn't realize how old this one was when I dug it up...). I can use the default instrument, change instrument using the web interface (so the age/specs of the Pi don't appear to be a problem).

I followed the directions for enlarging the samples partition, sshing into the SamplerBox, but at the final step, when I go to write the new partition table to disk, I get the following error:

Quote:The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

After reboot, however, the partition remains the same size. Here is the output of df -h

Quote:root@samplerbox:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2  1.6G 1006M  470M  69% /
/dev/mmcblk0p1  64M  22M  43M  34% /boot
/dev/mmcblk0p3  128M  106M  23M  83% /samples


Yet if I run fdisk and print the partition table, it has remembered the resize through the reboot (apologies for the large paste--I'm not sure what info could be relevant here):


Quote:root@samplerbox:~# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 7.5 GiB, 8010072064 bytes, 15644672 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
Disklabel type: dos
Disk identifier: 0x67e24ed1

Device        Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      2048  133119  131072  64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      133120  3459071  3325952  1.6G 83 Linux
/dev/mmcblk0p3      3459072 15644671 12185600  5.8G  7 HPFS/NTFS/exFAT

I've tried a few different SD cards, but always the same problem. Any ideas?

Thanks,

Chris
Hi Chris,
Yes, I do have an idea - the docs are not complete Blush
The filesystem (the thing you see with 'df') has not been enlarged yet to the size of the underlying partition.
This has to be done on a reboot following the partition change with fdisk which did the job of making room on the partition for filesystem expansion.
Code:
ntfsresize /dev/mmcblk0p3
Omitting the size parameter should enlarge the filesystem to all available space.
Not sure whether you need to make the samples partition writeable first.

I would appreciate if you could test this (=is R/W a prereq) and feedback, so that I can complete the docs in a correct way.
This is the first release with the samples on NTFS and this documentation omission escaped correction.
I'm sorry for that and thank you for this feedback!
Regards, Hans

PS: the speed of your old PI may be a problem depending your use, in that case the "clicks & plops" FAQ becomes important. But first have fun getting to know this thing  Cool
That did the trick! Thanks so much. I could kick myself, I had seen the ntfsresize command when I was googling, but obviously hadn't tried it.

I did need to unmount the partition, run ntsfsresize, and then I rebooted. I've since uploaded some samples, and gotten them to run, so all is well! And my needs are pretty modest, so this old Pi may just manage! 

For reference, her is a cut/paste of how it went:

Quote:root@samplerbox:~# umount /dev/mmcblk0p3

root@samplerbox:~# ntfsresize /dev/mmcblk0p3
ntfsresize v2014.2.15AR.2 (libntfs-3g)
Failed to set locale, using default 'C'.
Device name        : /dev/mmcblk0p3
NTFS volume version: 3.1
Cluster size      : 4096 bytes
Current volume size: 134214144 bytes (135 MB)
Current device size: 6239027200 bytes (6240 MB)
New volume size    : 6239023616 bytes (6240 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use      : 111 MB (82.6%)
Collecting resizing constraints ...
WARNING: Every sanity check passed and only the dangerous operations left.
Make sure that important data has been backed up! Power outage or computer
crash may result major data loss!
Are you sure you want to proceed (y/[n])? y
Schedule chkdsk for NTFS consistency check at Windows boot time ...
Resetting $LogFile ... (this might take a while)
Updating $BadClust file ...
Updating $Bitmap file ...
Updating Boot record ...
Syncing device ...
Successfully resized NTFS on device '/dev/mmcblk0p3'.
root@samplerbox:~#

I then rebooted and all was as expected---the partition had been expanded. I probably could have just remounted... but a reboot is so quick that I tend to reboot, and remove one more opportunity for error.

Thanks so much for the help!

Chris
Hi Chris,
I've updated the documentation, thanks for pointing this out and verifying correct way,
Hans