I have a spare drive which had been in a RAID array and I want to put it in an external USB drive case. I do not have the case yet but meanwhile have a drive dock and wish to check the drive.
Trouble is that although the drive is Sata and almost bound to have SMART, I cannot get DisKMonitor to recognise it. I can access the drive using Dolphin and there is a lost + found directory I cannot remove. I have now deleted all partitions with gparted but whenever I try and create a new partition (Ext4) I still found I had several GB in use. Have now reformatted to Ext3 and that may have done the trick but how can I now check the drive for faults. Is it possible the USB docking station is in the way of SMART and how can I get around the problem? If possible I would like to get disk back to “factory” condition.
I do not think smart is interested if you have partitioned the disk and if you have file systems on those partitions or not. Smart checks hardware blocks.
Apart from that, when you say there is a file system on it (either on a partition or on the whole disk, then there must be a device file for it (/dev/sdaN) and I assume (I never used Smart) that that is the parameter you have to tell smart to check.
There being a lost+found in a file system is very normal. And it will be re-created when you delete it.
In any case, when you want help about disks, partitions, etc. the least you can do is post
su -l -c 'fdisk -l'
Hi Henk,
yes of course. I have now reformatted as btrfs and here is the result of running fdisk you advised:-
alastair@ibmserver2:~> su -l -c 'fdisk -l'
Password:
Disk /dev/sda: 5.5 TiB, 5993995960320 bytes, 11707023360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F2939456-093E-4312-9091-673EDA79A76E
Device Start End Sectors Size Type
/dev/sda1 2048 321535 319488 156M EFI System
/dev/sda2 321536 4530175 4208640 2G Microsoft basic data
/dev/sda3 4530176 88422399 83892224 40G Microsoft basic data
/dev/sda4 88422400 1162158079 1073735680 512G Microsoft basic data
/dev/sda5 1162158080 11684829469 10522671390 4.9T Microsoft basic data
Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x000c62c0
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 3907028991 3907026944 1.8T 83 Linux
alastair@ibmserver2:~>
This shows only 112.00KiB “used” but I cannot create a file using dolphin. Not sure if btrfs is beyond my docking station’s capability so have tried again.
If I reformat as ext4 a massive amount of 29.42 GiB out of 1.82 TiB is shown as “used.”
The inability to create a directory is just a permissions issue so two questions:
How can I make the USB drive accessible to me?
Why is so much of the drive used?
I am still confused about what you want.
On one side you are talking about SMART, which is (as I understand) a tool that checks for bad spots on disk, thus very much near the hardware.
On the other side you talk about Dolphin, which is a file manager of a desktop suite (KDE) and thus works on the file level somewhere in the directory tree (mainly in parts of the tree accessable for the end-user, like his home directory).
Between both ways of looking at a disk (hardware blocks vs. files) there are several other other layers like partitioning, file system and mounting.
Thus starting from “low”. For running SMART (I never did) you only need the device file of the disk, which (from your posted information) is /dev/sdb. Please tell if you still want to run SMART and when yes, if yo have problems doing so on /dev/sdb.
Then you seem to want to partition it. If you did that or if it was already done earlier I can not say, but the information above shows that there is a DOS (or MBR) partition table and that it shows 1 partition (/dev/sdb1) that covers the whole disk (~1.8 TiB).
I have one remark here. Your system disk is GPT partitioned. Why did you fall back to DOS partitioning on this one? It could be it was already so from the start the start though. It does not matter much, but “reaching for the future” and such things.
You are very aware that /dev/sdb1 does exist, because you say that you created (at least) three times three different types of file system on it: ext4, ext2, btrfs. Now that is fine experimenting (and you could also try xfs, Reiser and more), but you better decide what you want and that depends on what you want to use the disk space for. I do not think it is recommended to use btrfs for a non root file system because the main reason to use btrfs is snapper. You can of course use snapper on a “data” disk, but then you have to design the policy when to make snapshots, etc.
After you created the file system, the next step is mounting it somewhere in the one and only directory tree a Unix/Linux system has. And that again brings us back to the all important question: What do you want to use that disk space for? The answer to that question comes even before partitioning, because it decides how many partitions you want to have and how large.
In any case, when the answer on that important question is still not clear and you want to experiment a bit, you could use a mount point inside /mnt, like /mnt/extradisk.
I do not know which tool(s) you used until now to do the partitioning and the file system creation, but I would recommend YaST > System > Partitioner, which can do the partitioning, the file system creation and the mounting (including mount point creation and /etc/fstab configuring). All in one. You see the fields that you can fill in (some have problems using the mount point field, remark that you are nor restricted to the list of suggestions there, but you can type e.g. /mnt/extradisk in that field when needed).
The last part then comes when people find out that an end-user has no permission to read/write in (our example) /mnt/extradisk. That has of course nothing to do with the fact that it is a separate disk/partition, but all with owneship/permisions, like each and every directory/file in the system.
Thus, when you want to give user alastair the rights to do there what he wants, you should make him owner of /mnt/extradisk
chown alastair:users /mnt/extradisk
And when user alastair then wishes to have more easy access to that space then going trough /mnt/extradisk/…, he could create a symbolic link from somewehere in his home directory. E.g. when he wants to use that to store his videos, from his home directory:
ln -s /mnt/extradisk myvideos
And the comes the last surprise. When you now start an end-user GUI file manager like Dolphin, you will see in the home directory: myvideos. And you can cllick on that and then get presented the contents of myvideos, which is then the same as the contents of /mnt/extradisk, en so on to make, delete, etc. files there. Same like the avarage Windows user.
For ease of reading I removed all of sda4 above!
I do not see anywhere above the amount of “112.00KiB”. Please explain.
Again, I do not see the number "29.42 GiB"in the information provided by you. Please explain.
I am confused about this. But I get the idea that you post conclusions you have drawn based on data that you do not show. If that is true, please understand that we then can not follow you. We must see the data and then will draw our own conclusions. They may differ from your conclusions, but that is why you ask for help I assume.
Hi Henk,
Please forgive if I am not making myself clear. Trying to be brief and multitasking.
The background to my mentioning SMART is that the disk might have been removed from a RAID array because it failed in some way and my initial intent was to check it using SMART. Further reading suggests that this is frustrated in my case because my drive docking station (Akasa AK-DK05U3-BKCM DuoDockX) probably does not support smart.
I then Yast > System > Partitioner and had some issues which resulted in Partitioner exiting without seeing the USB drive.
I then went to gparted and was able to operate on the drive. It is gparted which tells me the amount of space used. I delete the old partition (ext4 but part of RAID array) and then created a new partion with ext4 format to ensure there were no RAID related features on the drive. The new arrangement still showed the massive (5%) usage and thereafter I did some experiments to try and find out what was going on and if I could achieve a “clean” drive. I could not get rid of the used 5% but have now saved about 1 TiB of data and will test it in use.
I shall be happy to run other tests but have no idea what these should be.
Hope this clarifies things a bit.
Budgie2
A bit yes. But again, just telling fairy tales about 5% or whatever does not work. We can only act on you posting hard facts. Like you did with the fdisk. And that shows that partition sdb1 is using all of disk sdb (well, the partition table also needs place of course and often at the end there is some rounding off).
When you want to show how large the file system is and how much is in use/free, you use
df -h /dev/sdb1
And saying that using the YaST partitioner you “had some issues” is not helping us in helping you. I advised you to use it to let it do all you seem to want (at least for the moment). Why don’t you just try and then explain/show what “issue” you have and where you got stuck? I (and others) are willing to help you in using it, but when you have no factual question, we can’t
Me sitting here and seeing your next post and thinking that you did something useful is a bit frustrating getting a post that includes no new technical information. Not one tiny step further.
Hi Henk,
Sorry again. The issues were
issues which resulted in Partitioner exiting without seeing the USB drive.
By this I mean the partitioner just did not complete initialisation but exited before displaying anything. After several attempts I now have the Yast partitioner working as it should so have started over. I have created an extended partition and a volume? formatted with ext4. The relevant part of fdisk output is:-
Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x000c62c0
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 3907028990 3907026943 1.8T f W95 Ext'd (LBA)
/dev/sdb5 4096 3907028990 3907024895 1.8T 83 Linux
alastair@ibmserver2:~>
Gparted still reports (with whole drive formatted as one partition with ext4) the size of the drive to be 1.82 TiB with 29.42 GiB used. I cannot find the 5% reference again but running df is beginning to shed more light. I now have /dev/sdb1 and /dev sdb5 as you can see above and df gives:-
alastair@ibmserver2:~> df -h /dev/sdb1
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.9G 8.0K 7.9G 1% /dev
alastair@ibmserver2:~> df -h /dev/sdb5
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.9G 8.0K 7.9G 1% /dev
alastair@ibmserver2:~>
So the “used” space is used by devtmpfs.
I have never seen this before on my systems and google doesn’t help much. Perhaps you can explain. I note that Gparted and Yast partitioner report different sizes for the same thing which begs another question.
Bottom line is that the drive appears to be working but please can you explain what is going on as, during my experiments with different file systems reported earlier, the “used” size differed significantly.
I would also appreciate your advice or formatting given your comment:
Your system disk is GPT partitioned. Why did you fall back to DOS partitioning on this one?
I have done it differently this time by not electing to have a Primary partition. Is this what you meant?
Sorry if you feel we are not making progress but I really do appreciate your help and tolerance and I am learning something new with each message.
Why are you doing things very different from the advice.
Why the extended partition???
From that point on all further telling and showing is nuts because now you have a file system on sdb5 instead of sdb1. And sdb1 is sitting in between for nothing.
I really do not know how to tell you what to do. You had already the correct partitioning with sdb1 as the only, disk filling partition. Why did you get the idea of changing that?
Again go to YaST > Partitioner. Go to /dev/sdb and say you want to edit it (I assume you have done that earlier so I do not have to tell you every click there.
Remove sdb5
Remove sdb1
Add a new partition.
It will show you the maximum available, use it.
Next it offers you the possibility to decide the type of usage, use for Data
Next it will show you a screen where you can choose Format it, that should be checked, and the file system type, my advice: ext4, no Encryption.
ASt the right check Mount the partition and then in the Mount point field enter /mnt/extradisk (you may want to use a different name then extradisk there).
Finish.
Now after this use
su -l -c 'fdisk -l'
and
df -h
to post the results here.
DO NOT USE ALL SORTS OF OTHER TOOLS AND CERTAINLY DO NOT JUMP TO CONCLUSIONS FROM WHAT THEY DISPLAY.
And when you during following the recipe above have any questions, ask them, but do not jump to conclusions, strange experiments or other things before you asked.
Because you asked why DOS. All I had done previously was what you now ask me to do. I have no idea where dos came into it other than the label reported by fdisk.
Why the extended partition???
Because you didn’t like my first attempt which was a Primary and there were only two choices so I tried the second.
From that point on all further telling and showing is nuts because now you have a file system on sdb5 instead of sdb1. And sdb1 is sitting in between for nothing.
True. I have no idea why it went to sdb5. Not any option I was given.
I really do not know how to tell you what to do. You had already the correct partitioning with sdb1 as the only, disk filling partition. Why did you get the idea of changing that?
Again go to YaST > Partitioner. Go to /dev/sdb and say you want to edit it (I assume you have done that earlier so I do not have to tell you every click there.
Remove sdb5
Remove sdb1
Add a new partition.
It will show you the maximum available, use it.
Next it offers you the possibility to decide the type of usage, use for Data
Next it will show you a screen where you can choose Format it, that should be checked, and the file system type, my advice: ext4, no Encryption.
ASt the right check Mount the partition and then in the Mount point field enter /mnt/extradisk (you may want to use a different name then extradisk there).
Finish.
Now after this use
su -l -c 'fdisk -l'
and
df -h
to post the results here.
DO NOT USE ALL SORTS OF OTHER TOOLS AND CERTAINLY DO NOT JUMP TO CONCLUSIONS FROM WHAT THEY DISPLAY.
And when you during following the recipe above have any questions, ask them, but do not jump to conclusions, strange experiments or other things before you asked.
OK here is the first for sdb part only:-
Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x000c62c0
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 3907028990 3907026943 1.8T 83 Linux
alastair@ibmserver2:~>
and here is the second:-
alastair@ibmserver2:~> df -h /dev/sdb1
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 1.8T 68M 1.8T 1% /mnt/external
alastair@ibmserver2:~>
Still see 68M used but no devtmps. The only difference from my first attempt was that I set the partition to be mounted.
Should I now try and use it again?
I asked you why, but you did not answer. I did not ask you to run wild and try all sorts of things. And certainly I did not ask you to create a DOS partitioning with an extended and a logical partition.
I seems that you lack some basic knowledge if I may be so free to mention that.
https://en.opensuse.org/SDB%3ABasics_of_partitions,_filesystems,_mount_points
You made an extended partition and that is, because there are no others, then sdb1. Then you created a logical parrtition inside it. Logical partitionss always have number >4, thus sdb5
The devtmps was the result of on of your experiments, forget about it.
The 68M is just the administration of the file system. I file system is some organisation on disk. There are inodes all over the file system. They are created when you make (some MS-DOS oriented people say: format) the file system. These all take space.
Now it is mounted and thus is an integral part of the directory tree (that starts at /) on your system.
I will repeat now the next steps, I already posted earlier:
When you want to give user alastair the rights to do there what he wants, you should make him owner of /mnt/external
'su -l -c 'chown alastair:users /mnt/external'
And when user alastair then wishes to have more easy access to that space then going trough /mnt/external/…, he could create a symbolic link from somewehere in his home directory. E.g. when he wants to use that to store his videos, from his home directory:
ln -s /mnt/extradisk myvideos
To answer about smart you use the program smartctl
smartctl /dev/sdb
smartruns agenst th disk not a partitionon the disk
for other options type man smartctl
Hi and thanks. Yes I use it from time to time on NAS boxes and servers. This is the first time I have needed to try on a USB drive, in fact the first USB drive I have ever used. I gather success depends upon, inter alia the docking station chip set and it does not work with my rather old device. Will try again when new drive case arrives.
Thanks again for the reply.
Budgie2
Hi Henk, thanks for the link and the change of ownership and mounting instructions. There was no need to repeat. Only one thing worries me and that is your reference to DOS. I cannot see where DOS comes into anything I have done and have only ever selected ext4 or btrfs in my trials. Why do you insist I have created a DOS partition?
As I type the drive seems to be working and I am loading data. It will take a few hours more and will test tomorrow.
Regards,
Budgie2
In this case DOS refers to the type of partition tables not a file system. GPT is the new preferred partitioning method. GPT supports drives larger then 2 TB and does not use extended or logical partitions it does not have the 4 partition limit of DOS tables
Hi and thanks for that but when I used Yast Partitioner to create a partition I was only given the choice of Primary or Extended and you have seen the results above. At no point was I given the choice of DOS vs GPT so what have I done wrong and how should I proceed to use GPT?
Like #gogalthorpe says, you are (still) mixing up things terribly. Read the link that I posted above.
Do not fall into the trap that many people use the word “partitioning”" and “partitioner” for a range of actions: managing partitions, managing file systems and, like in the case of YaST, even managing mount points and the fstab.
Even if in day to day talk these are often all under the umbrella “partitioning” they are all different things and onee should really understand what is what and what possibilities and choices belong to what.
The problem is that talking “loosely” about partitioning by those who know, leads to confusion and misunderstanding in newbies. The more because they tend to use the same wording (sounds good when you use the lingo, doesn’t it?) without the same background thoughts about the meaning as the gurus.
Partitioning is dividing the disks in parts that each can be used as if they are a disk. Like partitioning a pie. For Linux there are nowadays two types of doing this: DOS (or MBR) partitioning and GPT partitioning. The first is the classic one.
Your sda is partitioned with GPT and your sdb is now partitioned using DOS/MBR. Never mind. In this case there are no drawbacks in having sdb with DOS/MBR. The disk is smaller then 2TB and you only want one partition. Everything alright.
The next thing is what you want to do witth the partitions. Partitions are only space, or boxes, or containers. Putting strawberries on one pie partition. putting cottage cheese on another. Using one disk partition for Swap, another for a file system and another again for a Volume Manager, …
In this case, you choose to put a file system on sdb1. The next question is then, which type of file system? You choose ext4. I hope you understand that the type of file system, (nor what files you store there) has anything to do with the type of partitioning underneath.
Like the fact that you made one piece of the pie a strawberry pie and the other a cottage cheese pie has nothing to do with the way you cut the pieces, with a knife or a sword.
Please skip the next section of my post if it is beyond your understanding.
You could ask yourself why on earth would i take the trouble to partition a disk into only one partition? Why would you want to cut a pie into only one piece?
The answer is, there is no need. You can create that ext4 file system directly on sdb. No need to create any partitioning.
BUT, because the Master Boot Record and the partition table are all in one structure at the start of the disk, you need it when you want to boot from the disk. Thus, when you want to boot from a disk, you need an MBR and when you need an MBR, you need partitioning and when you need partitioning, you need at least one partition.
And in day to day life most people partition even in the case of no boot required and only one partition needed. The fact that this is almost always done apparently leads to the believe that partitioning is a MUST. This is not the case, but an urban legend.
I assume because the disk was already DOS/MBR partitioned. And remember, you used YaST to change the existing partitioning, not to create a new one!
I never tried, but I could imagine that erasing the MBD/partition table and then starting YaST might offer you a new option (or even GPT by default).
Also using gdisk might help.
But please don’t. At least when you do, do not ask me for help. I am not willing to spend the same amount of time as I already did for such a basic action as we now managed to do.
Not quite correct an therein lies the root of our misunderstandings. Perhaps if you had tried you might have been able to see things from my point of view. When I did use Partitioning tool having wiped the disk, I was not offered a new option and certainly not GPT by default.
All I wanted was to wipe clean and by that I mean restore to factory unused condition (which is not strictly unused but free from any clutter which operating system and hardware RAID might have created,) and reformat the disk. Being cautious I thought I could use Yast tool to do this and hence was taken down the partitioning route as I was not confident in using mkfs before wiping the disk.
Also using gdisk might help.
But please don’t. At least when you do, do not ask me for help. I am not willing to spend the same amount of time as I already did for such a basic action as we now managed to do.
I have read the article and noted the additional links which I shall read. I understand your frustration and am sorry it has been such a struggle, especially as I am very keen to get rid of MBR and just have a plain ext4 disk with my data as you indicate is possible. Clearly though I shall have to do it from console not by using the Partitioning tool and will have to do it without help.
Best wishes and thanks again.
Budgie2
… you did not look hard enough.
In the Yast Partitioner, in the left pane under Hard Disks, you select the drive (sda, sdb, or whatever). Just select, do not double-click or anything else silly.
Now, bottom right is a button labelled Expert. In there choose Create New Partition Table. A popup will then give you the choice of MSDOS or GPT.
Simple, eh?