Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 10:36 am

I have bought a 4TB USB drive to use on an RPi4.
I want to use ntfs so it can be attached to windows 10 too.
So I will mount it through fstab as an ntfs file system and all of that works OK.
But when I look at the disk in Raspbian Buster I see this (the response edited to remove the internal SDcard):

Code: Select all

$ sudo blkid
/dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="4b1c6ae1-5acc-426f-b668-7450c214fb69"
/dev/sda2: LABEL="Seagate Expansion Drive" UUID="ACA013FDA013CCA8" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Basic data partition" PARTUUID="e68c8d1b-2d97-4a3f-acda-58ae0cef9b53" 

$ sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL
UUID                                 NAME        FSTYPE  SIZE MOUNTPOINT LABEL                   MODEL
                                     sda                 3.7T                                    Expansion
                                     ├─sda1              128M
ACA013FDA013CCA8                     └─sda2      ntfs    3.7T            Seagate Expansion Drive

Notice that the drive I want to use appears as sda2 instead of sda1 because the drive has this extra partition.
I have another 1TB drive on another RPi but this does not have the extra partition...

So I moved the drive to my Windows10 PC and opened disk management hoping I could just remove this bogus partition, but it is not shown there!

QUESTION:
How can I get rid of the extra partition so the drive shows up with only sda1?
Bo Berglund
Sweden

DirkS
Posts: 10347
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 11:30 am

I would delete all partitions and create a single primary partition.
Use fdisk, parted or gparted.

Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 11:51 am

Can I create an ntfs disk that way?
I have never used any of these tools in Linux, just the GUI tools in Windows and since the hidden partition is not visible on Windows it seems like that is not capable of doing the correct thing...
Well, I guess I have to start googling for fdisk, parted and gparted in Linux....
Bo Berglund
Sweden

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 11:59 am

Bosse_B wrote:
Sun Mar 01, 2020 11:51 am
Can I create an ntfs disk that way?
Use [WIN]+[R] to run diskmgmt.msc on a Windows system to create an NTFS drive. It's easier that way.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

LTolledo
Posts: 3321
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 12:23 pm

ever since I've known about gparted, I always formatted my drives using it, specially when formatting to NTFS....
as formatting it using gparted does not produce "hidden surprises" unlike when formatted under a w$ system.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 12:29 pm

Well, in Windows 10 I selected the existing partition on diskmanager and deleted it, then created a new simple volume and formatted it as ntfs.
When I move this to the RPi4 it still shows up as follows:

Code: Select all

/dev/sda2: LABEL="Data" UUID="3C98544E98540932" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="9ec9af8a-936e-4f5c-8303-18e9501c4977"
/dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="4b1c6ae1-5acc-426f-b668-7450c214fb69"
So there is still this extra sda1 located partition....-
Bo Berglund
Sweden

jahboater
Posts: 5680
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 12:32 pm

Try gparted then.

If the extra partition is still there, then it may be required for alignment purposes ?
Pi4 8GB running PIOS64

Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 1:10 pm

LTolledo wrote:
Sun Mar 01, 2020 12:23 pm
ever since I've known about gparted, I always formatted my drives using it, specially when formatting to NTFS....
as formatting it using gparted does not produce "hidden surprises" unlike when formatted under a w$ system.
It seems like gparted is not available on the RPi4 Raspbian Buster Lite....
Note that my RPi is headless and has no installed GUI.
I do have another RPi4 with the GUI, so I installed it there and moved the disk to this RPi4.
Then I used Gparted to clean up the disk of all partitions and then created a new gpt table and a primary partition for ntfs.

It turns out that I had to create a new mount point /mnt/data for this disk after the partition fixing because now the fstab entry for the old mount point did not work even if I entered the correct UID in fstab...
But after creating /mnt/data and using that in fstab the drive mounted OK and is now only containing sda1.

Seems like the old mount point is still somewhere connected to my original disk (with a different UID) and this blocks using it for the new (but same) drive.

But anyway it now works.
Thanks for your suggestions!
Bo Berglund
Sweden

Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 1:42 pm

Just an additional note:
After I visited my Windows computer with the newly partitioned drive it now show extra rubbish when I list it on the RPi4:
(I created the dir "diabilder" on my RPi4 but what can I do regarding the extra two directories?

Code: Select all

~/data $ ll
total 1
drwxrwxrwx 1 pi pi 0 Mar  1 13:53 '$RECYCLE.BIN'  <== THIS!
drwxrwxrwx 1 pi pi 0 Mar  1 14:36  diabilder
drwxrwxrwx 1 pi pi 0 Mar  1 13:53 'System Volume Information'  <== AND THIS!
Are they required by Windows?
Bo Berglund
Sweden

GlowInTheDark
Posts: 594
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 1:58 pm

All of these people giving "suggestions" are missing the essential point, which is "How did it get this way?"

Did it come that way from the factory?

The history is all important. We'd need to know how that partition got there, where it came from, before we can advise you to try to remove it.

FWIW, when I first saw this thread, my first reaction was that this was one of those Windows "Recovery" partitions - you know, that allow you to re-install Windows from scratch if something goes wrong. If that is the case, then you probably don't want to delete it. You might need it someday.

Even if that is not the case, it is probably there for some, probably weird, but essential, Windows reason. I'd be leery of removing it; who knows what Windows needs nowadays?
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
PeterO
Posts: 5829
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 2:17 pm

GlowInTheDark wrote:
Sun Mar 01, 2020 1:58 pm
We'd need to know how that partition got there, where it came from, before we can advise you to try to remove it.
Since the advice given has allowed OP to successfully remove the partition (a few post back) your assertion is incorrect !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

GlowInTheDark
Posts: 594
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 2:46 pm

GlowInTheDark wrote:
Sun Mar 01, 2020 1:58 pm
We'd need to know how that partition got there, where it came from, before we can advise you to try to remove it.
Since the advice given has allowed OP to successfully remove the partition (a few post back) your assertion is incorrect !
(Garbage.)
We don't know what the downstream implications are. Of course, it is easy to give advice and for him to act on that advice to delete partitions. That's beside the point.

We just don't know if the next post from him is going to be "My Windows 10 system doesn't boot anymore." and "I'm suing everyone who gave me bad advice".

Admitedly, these dire outcomes are unlikely, but what if the user is confused about which device he is actually manipulating? We all know how easy that is. What if he does end up mucking up something critical? You want that on your conscience?
Last edited by GlowInTheDark on Sun Mar 01, 2020 3:03 pm, edited 1 time in total.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
PeterO
Posts: 5829
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 2:59 pm

GlowInTheDark wrote:
Sun Mar 01, 2020 2:46 pm
We don't know what the downstream implications are. Of course, it is easy to give advice and for him to act on that advice to delete partitions. That's beside the point.
No, that's exactly the point, that's what these forums are all about.People ask questions, others make informed suggestions, they try them out and report if they work or not. WHat you are proposing stops the whole process working because no one will risk the repercussions.
We just don't know if the next post from him is going to be "My Windows 10 system doesn't boot anymore." and "I'm suing everyone who gave me bad advice".
This is pure scaremongering !
Admitedly, these dire outcomes are unlikely, but what if the user is confused about which device he is actually manipulating? We all know how easy that is. What if he does end up mucking up something critical? You want that on your conscience?
I didn't give any advice in this thread because I've never had to deal with disks with ntfs partitions or that have to be used on Windows as well (besides a USB stick that is). If you give advice about things you don't understand you are a fool !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 3:10 pm

This is about a newly bought Seagate Expansion Portable Drive connected by USB (sda) and sized 4TB.
It is to be used as data storage on an RPi4 system which will be relocated to my daughter's home as protection against loss in a fire or similar.
I will connect to it using OpenVPN when I have new data to store there.

The data comprise an archive of scanned slides and other material, so I want to connect the drive to Windows in order to load the existing data initially and then attach it to the RPi4 for normal use there.
I have never indicated that the drive was part of any Windows system and as being an USB connected drive it could not hold a Windows rescue partition...

I have built other RPi systems before using USB drives and they only had a single partition that appeared as sda/sda1.
So this thead is about getting rid of the extra partition on this drive...

Which is now fixed using gparted.
Bo Berglund
Sweden

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 3:42 pm

Bosse_B wrote:
Sun Mar 01, 2020 3:10 pm
Which is now fixed using gparted.
:)

As to those other two directories created by Windows. I believe the System Volume Information one is created by the Windows drive indexing function. There is an option somewhere in Windows to prevent indexing of removable drives, which will stop it from creating that. I don't know if there is a way to prevent it creating a Recycle Bin
Unreadable squiggle

User avatar
procount
Posts: 2209
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: How to get rid of extra partition on usb drive?

Sun Mar 01, 2020 9:53 pm

Disk drives are partitioned as MBR or GPT types.
MBR only caters for upto about 2.2TB, so larger disk drives are formatted as GPT.
GPT drives have an extra partition of about 128MB that is reserved for use by the operating systems. This is the partition you are seeing.
I'm not sure what it is used for but I think most GPT based drives will have it.
Raspberry pi will only boot off an MBR partitioned drive.
Look up gpt and Microsoft reserved partitions on Google for more info.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Bosse_B
Posts: 966
Joined: Thu Jan 30, 2014 9:53 am

Re: How to get rid of extra partition on usb drive?

Mon Mar 02, 2020 8:18 am

procount wrote:
Sun Mar 01, 2020 9:53 pm
Disk drives are partitioned as MBR or GPT types.
MBR only caters for upto about 2.2TB, so larger disk drives are formatted as GPT.
GPT drives have an extra partition of about 128MB that is reserved for use by the operating systems. This is the partition you are seeing.
I'm not sure what it is used for but I think most GPT based drives will have it.
Raspberry pi will only boot off an MBR partitioned drive.
Look up gpt and Microsoft reserved partitions on Google for more info.
OK, thanks for the info!
I have meanwhile reset the drive totally and re-partitioned it using gparted on an RPi with the GUI installed.
I then used the GPT based partitioning format since the drive was 4TB in size and I created the ntfs file system.
It seems to have worked OK and the disk now has only one partition using all of the drive space.
It works on both Windows10 and my RPi4, but when I inserted it into Windows it created the two extra directories $RECYCLE.BIN and "System Volume Information".
This drive will only ever be used to hold data, never an operating system.
Bo Berglund
Sweden

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to get rid of extra partition on usb drive?

Mon Mar 02, 2020 9:03 am

If it's only ever going to be used on your Raspberry why are you persisting with the slow NTFS format. Make it an EXT4 drive (or if you want to upset Linus Torvalds make it a ZFS drive).

Linux native filesystems have kernel drivers.
NTFS-3G is a userland driver.

Kernel drivers are much faster than userland drivers.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

LTolledo
Posts: 3321
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: How to get rid of extra partition on usb drive?

Mon Mar 02, 2020 9:36 am

DougieLawson wrote: If it's only ever going to be used on your Raspberry why are you persisting with the slow NTFS format.
I second (and third !!) this. :D
if you want windows to have access to the USB drive connected to the RPi, share it across the network using samba.

just a while ago I tested a drive (its an SSD though, formatted to EXT4) connected to a RPi4B and shared via samba.
and made a 5.5GB file transfer from w$ to RPi4B-4G shared drive.

this is what I saw.
w10 to RPi4B-4G samba share file transfer.jpg
w10 to RPi4B-4G samba share file transfer.jpg (17.17 KiB) Viewed 557 times

....and this is what DougieLawson meant with the NTFS formatted drives....
(I've attached a NTFS formatted HDD to RPi4B-4G, shared it to the network via samba and copied the same file I copied earlier)
again this is what I saw.
w10 to RPi4B-4G samba share file transfer spinning rust NTFS.jpg
w10 to RPi4B-4G samba share file transfer spinning rust NTFS.jpg (17.74 KiB) Viewed 538 times
Last edited by LTolledo on Mon Mar 02, 2020 10:00 am, edited 1 time in total.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
PeterO
Posts: 5829
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to get rid of extra partition on usb drive?

Mon Mar 02, 2020 9:58 am

I'm not sure what the fuss is about. These extra directories are really no different to the "lost+found" directory created in every ext(234) file system.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to get rid of extra partition on usb drive?

Mon Mar 02, 2020 10:07 am

PeterO wrote:
Mon Mar 02, 2020 9:58 am
I'm not sure what the fuss is about. These extra directories are really no different to the "lost+found" directory created in every ext(234) file system.
Hence my suggestion to format it on Windows so that it has the pieces that Windows needs to work correctly.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

LTolledo
Posts: 3321
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: How to get rid of extra partition on usb drive?

Mon Mar 02, 2020 10:19 am

.... and posting the final one
EXT4 formatted HDD...on RPi4B-4G.... shared to the network via samba ... and copied the same 5.5GB file mentioned earlier.
w10 to RPi4B-4G samba share file transfer spinning rust EXT4.jpg
w10 to RPi4B-4G samba share file transfer spinning rust EXT4.jpg (16.95 KiB) Viewed 517 times

the HDDs/SSDs were connected to USB3.0 port during the test, as my USB2.0 ports are already occupied by other devices.

I forgot to mention earlier that I was able to erase the Sytem Volume Information and Recycle bin on the NTFS shared drive
I shared the whole drive and it was "visible" on the w$ file manager.
selected those 2 directories and pressed delete.... and "poof" gone! :D

I got rid of those extra partitions on the network shared NTFS drive....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “General discussion”