Accessing sdb1 on Ubuntu machine
Good Day,
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. Your Thoughts / Recommendations Thanks, |
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. |
|
This has really helped me.
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? I'm on Ubuntu 18.04 Thanks, |
Defaults is basically a shortcut for these options: rw, suid, dev, exec, auto, nouser, async, and relatime. See man mount pages for details.
I believe that note is specific for mounting a VFAT and not a linux filesystem. Based upon your previous thread did you want to add the new drive to an existing logical volume or keep it separate? The posted link should not be used verbatim. Make sure you use the filesystem type for /dev/sdb1 as it was formatted. |
agreed,
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. |
By using GPT you do not have the 2TB limitation and you can easily resize the disk, partition and filesystem as necessary.
sdb1 is not LVM and not part of any logical volume. |
Ok,
when i now do a fdisk on /dev/sdb I get the following... Disk /dev/sdb: 3 TiB, 3298534883328 bytes, 6442450944 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: F6B8150E-B3B2-4B11-99A9-5D2179F2B157 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:
Quote:
|
Ok,
That does make sense to me. I now seem to have it all running now!!! Thanks a million for your help!!! |
|
razaaan,
Welcome to LinuxQuestions. Please read the rules again. Seemingly random posts unrelated to the thread are frowned upon. https://www.linuxquestions.org/linux/rules.html |
Quote:
|
All times are GMT -5. The time now is 04:29 AM. |