LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-22-2019, 08:57 AM   #1
cis4life
LQ Newbie
 
Registered: May 2019
Posts: 14

Rep: Reputation: Disabled
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,
 
Old 05-22-2019, 09:07 AM   #2
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
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.
 
Old 05-22-2019, 09:11 AM   #3
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Perhaps this document will help?

https://help.ubuntu.com/community/In...gANewHardDrive
 
Old 05-22-2019, 09:29 AM   #4
cis4life
LQ Newbie
 
Registered: May 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
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,
 
Old 05-22-2019, 09:46 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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.

Last edited by michaelk; 05-22-2019 at 09:48 AM.
 
Old 05-22-2019, 10:00 AM   #6
cis4life
LQ Newbie
 
Registered: May 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-22-2019, 10:04 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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.
 
Old 05-22-2019, 10:11 AM   #8
cis4life
LQ Newbie
 
Registered: May 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
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?
 
Old 05-22-2019, 10:32 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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.

Last edited by michaelk; 05-22-2019 at 10:42 AM.
 
Old 05-22-2019, 02:05 PM   #10
cis4life
LQ Newbie
 
Registered: May 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
Ok,

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

Thanks a million for your help!!!
 
Old 05-22-2019, 04:59 PM   #11
razaaan
LQ Newbie
 
Registered: May 2019
Posts: 2

Rep: Reputation: 0
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

Last edited by razaaan; 05-23-2019 at 04:21 PM.
 
Old 05-22-2019, 05:27 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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
 
Old 05-22-2019, 05:32 PM   #13
razaaan
LQ Newbie
 
Registered: May 2019
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing files available within a virtual machine from the host machine ed.kumar Linux - Virtualization and Cloud 5 08-03-2011 03:25 PM
External USB HDD"Mounting local filesystems: /dev/sdb1 is not a valid block device" manudath Linux - Hardware 3 12-13-2004 09:59 PM
SDB1 IS NOT A VALID BLOCK DEVICE - CF reader help woodo Linux - Software 12 07-07-2004 09:52 AM
mount: wrong fs type, bad option, bad superblock on /dev/sdb1 pmoreira Linux - Hardware 5 02-26-2004 10:31 AM
sdb but no sdb1? Moebius Linux - Hardware 3 02-15-2004 06:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration