search

Resetting the msftres flag

It seems that there is a bug in GNU parted that results in the msftres flag being set when parted creates the NTFS filesystem. It only seems to affect drives with newer firmware, but the msftres flag sets the partition as a Windows reserved (hidden) partition and it won't mount. 
The workaround is to use mkfs instead of parted to create the file system.

However a problem is that mkfs requires around 100 MB of contiguous memory to create the filesystem and the GoFlex Home doesn't have that much available, so you will get calloc (Cannot allocate memory) errors.

Update: May 2020 - this procedure has been confirmed to work with larger drives, including 8TB Seagate Barracuda but you will need to increase the swap space to 300MB



To get around that problem you need to set up swap space on the hard drive first.
(commands are shown in blue)

/sbin/parted /dev/sda 

(parted) mklabel gpt 
(parted) unit MB
(parted) print



This will display the device space in MB. Mine shows Disk /dev/sda 3000593MB and we want 100 MB of swap space so

(parted) mkpart primary 0MB 3000493MB
(parted) mkpart swap 3000493MB 3000593MB

quit parted. 

you now have an empty primary partition with no filesystem and a swap partition. 

At this point there's no useable filesystem, so if you reboot the device it will show storage as



To make the swap space available (Note that swap is sda2 and the partition we want as NTFS is sda1)

/sbin/mkswap /dev/sda2
/sbin/swapon /dev/sda2 

Now create the NTFS filesystem with mkfs (the -Q flag is quick format. You can do a full format by omitting the -Q but it will take a  while)

/sbin/mkfs.ntfs -Q /dev/sda1

If it complains that the filesystem is in use, the simplest option is to reboot with /sbin/reboot (you will need to restart the PuTTY session)




After creating the NTFS partition, reboot the device /sbin/reboot and the NTFS partition should mount and you're in business.