LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Accessing sdb1 on Ubuntu machine (https://www.linuxquestions.org/questions/linux-server-73/accessing-sdb1-on-ubuntu-machine-4175654381/)

cis4life 05-22-2019 08:57 AM

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,

sevendogsbsd 05-22-2019 09:07 AM

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.

dc.901 05-22-2019 09:11 AM

Perhaps this document will help?

https://help.ubuntu.com/community/In...gANewHardDrive

cis4life 05-22-2019 09:29 AM

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,

michaelk 05-22-2019 09:46 AM

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.

cis4life 05-22-2019 10:00 AM

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.

michaelk 05-22-2019 10:04 AM

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.

cis4life 05-22-2019 10:11 AM

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?

michaelk 05-22-2019 10:32 AM

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.

cis4life 05-22-2019 02:05 PM

Ok,

That does make sense to me. I now seem to have it all running now!!!

Thanks a million for your help!!!

razaaan 05-22-2019 04:59 PM

I've been experiencing an issue on ubuntu and I figured out how to fix it, btw my issue was:
Unable to access “758 GB Volume”.
Dafont Showbox Adam4adam

michaelk 05-22-2019 05:27 PM

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

razaaan 05-22-2019 05:32 PM

Quote:

Originally Posted by michaelk (Post 5997906)
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

Thank you for your help then


All times are GMT -5. The time now is 04:29 AM.