Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Extremely new to Linux and this forum. Recently picked up a Raspberry Pi Zero W and am in the process of setting up samba to use as a NAS. I have two physical hard drives connected to it. I am attempting to mount both hard drives to a directory. First I need to format them correclty. The first drive (1TB) is called sda2. The second drive (320GB) is called sdb1. For the first one I run "umount /dev/sda2" and "sudo mkfs.ext4 /dev/sda2" These run no problem. However when I do the same for sdb1 it returns with "umount: /dev/sdb1: not mounted". I'm pretty confused why it says this especially because the sda2 drive did not
Also if anyone could explain what sda and sdb means that would be nice
Exercise you favourite search engine. here is one I found quickly. I'm sure there are better/more expansive answers out there.
/dev/sda is first hard disk/SSD/...
/dev/sdb is the second, and so on. Note these are (correctly) referred to as "drives".
Within a drive you have partition(s) - /dev/sda1, /dev/sda2, ...
Partitions house filesystems - which you create with mkfs, as you appear to know. The mount/umount commands refer to partition, but it's actually the associated filesystem that really gets mounted.
To check what is currently mounted use this command.
Hello,
However when I do the same for sdb1 it returns with "umount: /dev/sdb1: not mounted". I'm pretty confused why it says this especially because the sda2 drive did not
It gives this error because, very literally, /dev/sdb1 is not mounted. /dev/sda2 on the other hand was obviously mounted when you launched the umount command.
I am a bit confused and wonder if you do things right. A full disk is not named /dev/sda2. The naming convention is /dev/sda for SCSI disk a. sda2 stands for the second partition on that disk. The same convention is used for /dev/sdb1.
Quote:
Also if anyone could explain what sda and sdb means that would be nice
sd stands for "SCSI disk". A module in the Linux kernel translates SCSI commands to native USB, SATA etc commands, and Linux considers most storage devices as SCSI disks, even if they are not disks or they don't use the SCSI protocol, such as USB thumbdrives.
sd stands for "SCSI disk". A module in the Linux kernel translates SCSI commands to native USB, SATA etc commands,
Essentially "sd" is used for all mass-storage devices that are addressed by a direct block number, so NOT by a cilinder/track/sector adress (those are hd's).
SCSI addressing allows for 48-bits, so are large enough for all modern "disk-like" devices.
A little off topic for this thread but when libata (the kernel module as posted above) was implemented all storage media regardless of bus type are given a sd device designation including IDE/PATA. 48 bit logical block addressing was introduced in the ATA-6 standard.
For the OP IDE/PATA was the predecessor to the SATA bus. PATA i.e. Parallel ATA (AT Attachment) and SATA i.e Serial ATA.
To update this thread I figured out my issue. I was unsure what umount actually did and found later that it unmounts a drive. Also the drives I had connected had several partitions I did not realize about therefore I got confused when sda1, sda2, etc etc. were showing up.
As an aside, you would normally unmount the file system, which is normally mounted to a mount point in /mnt, /media, or /run/media/[username], not unmount it from /dev.
In other words, the command would be something like, for example,
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.