Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I added a new drive into my Ubuntu 18.04 VM. It shows up and I can see it so forth. When I try to cd into it ( cd /dev/sdb or cd /dev/sdb1 ) it says its not a directory. So i read about mounting it to a directory...
sudo mkdir /sdb
sudo mount /dev/sdb1 /sdb
Is that the proper way of handling this. and next question is...
Once the mount is set the first time, will it maintain on a system reboot.
My goal is to use the sdb location / drive to store generated files and data from my docker environment.
Personally, I wouldn't name a directory the same as a device name, might cause confusion. I would name it based on what it is for: data, documents, etc. The mount will not maintain across reboots unless you add an entry to /etc/fstab. The entries may vary in format depending on your particular Linux version so I would search the docs on what a proper fstab entry for Ubuntu should look like, based on your file system, etc.
Once you make an entry in fstab, test it first before a reboot to ensure the syntax is correct.
I agree, i named the directory something other than sdb1. Completely agree
One more question that I saw in the link you sent
/dev/sdb1 /media/mynewdrive ext3 defaults 0 2
I updating the file as instructed, but the 'defaults' setting it says that it will allow me to read, but may not allow me to write. What would i put there for both read and write?
The file system is currently formatted as ext4. I'm going to keep the sdb drive seperate and expand this drive as needed.
I seem (by using the document) was able to get everything up. I rebooted the server as well and I see the mounted directory show up as expected.
So now "I should" be able to add space as needed to /dev/sdb and it should show up in sdb (Its a VMWare VM) and then expand sdb1 with the added space... right? This is all setup now with gpt and lvm.
Device Start End Sectors Size Type
/dev/sdb1 2048 6442450910 6442448863 3T Linux LVM
So, just so that I'm understand. If I add more storage to the disk /dev/sdb, then when I resize sdb, sdb1 will resize as well, or do I have to resize sdb1?
A disk label is just a label. In your first post you wrote
Quote:
sudo mount /dev/sdb1 /sdb
Which does not indicate your using LVM. You would of used pvcreate to create a physical volume in sdb1. Then additional steps to create new or extend a volume group or logical volume. Check your fstab to see how your other filesystems are mounted.
Quote:
If I add more storage to the disk /dev/sdb, then when I resize sdb, sdb1 will resize as well, or do I have to resize sdb1?
You need to resize sdb1 as well as the filesystem within sdb1.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.