[SFS] mounting linux filesystem from local drives

David L. Willson dlwillson@sofree.us
Fri, 13 Jan 2017 08:49:20 -0700 (MST)


------=_Part_5877_469268119.1484322560547
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Some thoughts:=20
- I like UUID=3D... better than LABEL=3D... for specifying what to mount. I=
t's even less likely to change or collide. You can discover the current lab=
el, UUID, and some other interesting things by running `blkid` against the =
device.=20
- Editing fstab while the system is running is fine, iif you reboot or at l=
east run `mount -av` to verify that you did what you meant. Doing it optimi=
stically is a bad habit to get into.=20
- Starting with LVM and the smallest reasonable logical volumes is a really=
 good idea for machines that may be in service a long time.=20
- Labeled filesystems should appear by label in /dev/disk/by-label/ and not=
 in /dev/mapper/.=20

```=20
[dlwillson@intecrowd-vboxws ~]$ ls -l /dev/disk/by-label/=20
total 0=20
lrwxrwxrwx. 1 root root 9 Jan 13 08:20 VBOXADDITIONS_5.1.10_112026 -> ../..=
/sr0=20
[dlwillson@intecrowd-vboxws ~]$ ll /dev/mapper/=20
total 0=20
lrwxrwxrwx. 1 root root 7 Jan 13 08:19 centos-root -> ../dm-0=20
lrwxrwxrwx. 1 root root 7 Jan 13 08:19 centos-swap -> ../dm-1=20
crw-------. 1 root root 10, 236 Jan 13 08:19 control=20
[dlwillson@intecrowd-vboxws ~]$ blkid /dev/dm-0=20
/dev/dm-0: UUID=3D"6e274ff6-a3a5-4d02-9ace-1f99c11158ed" TYPE=3D"xfs"=20
[dlwillson@intecrowd-vboxws ~]$=20
```=20

--=20
David L. Willson=20
Teacher, Engineer, Evangelist=20
RHCE+Satellite CCAH Linux+ LPIC-1 SUSE_CLP LFCS=20
Mobile 720-333-LANS(5267)=20
http://sofree.us=20

This is a good time for a r3VOLution.=20

----- Original Message -----

From: "Jed Walker" <jedwa@comcast.net>=20
To: "Aaron Brown" <aayore@gmail.com>=20
Cc: "sfs" <sfs@thegeek.nu>=20
Sent: Thursday, January 12, 2017 9:04:11 PM=20
Subject: RE: [SFS] mounting linux filesystem from local drives=20



Yes, editing fstab while the system is running is fine, I=E2=80=99ve done t=
hat a ton. I was wondering about the xfs_admin command. If I have the time =
I=E2=80=99ll that command and see what happens (and reply). I just can=E2=
=80=99t afford to waste time fixing it since I have to get it to the DC Mon=
day.=20





Yes, I like LVM for adding more space but the drive bays are full so I figu=
red it wouldn=E2=80=99t be happening and we=E2=80=99ll hopefully move off t=
o a storage device for more space later.=20



I appreciate all the help, and thanks for the article on LVM and performanc=
e.=20




From: Aaron Brown [mailto:aayore@gmail.com]=20
Sent: Thursday, January 12, 2017 7:03 PM=20
To: Jed Walker=20
Cc: 'sfs'=20
Subject: Re: [SFS] mounting linux filesystem from local drives=20




It's definitely fine to edit the fstab while the drive is online. It *shoul=
d* be fine to provide a label with the drive online, but if you've got stuf=
f you can't lose I'd advise testing somewhere else or unmounting the drive =
first. I'm really not sure if FS labels show up under /dev/mapper/. I think=
 the label applies to the base block device, so I don't think device mapper=
 will pick it up and put it in /dev/mapper/. Let me know what you find out.=
 :)=20



Also - There's really no downside to LVM. It doesn't impact storage perform=
ace ( http://unix.stackexchange.com/questions/7122/does-lvm-impact-performa=
nce ) and it gives you a bunch of options that you might want in the future=
. If you ever start to run out of space, you could add a second RAID volume=
 and use LVM to concatenate them together. If space isn't an issue, then yo=
u've got room for snapshots.=20



Jed Walker wrote:=20




Thank you Aaron. It is being use now, so can I run that while it is=20
being used to give it a label, and then change the fstab and remount=20
later? Also, when you say a =E2=80=9Clabel=E2=80=9D does that mean it will =
show as=20
something like /dev/mapper/<label> ?=20



*From:*Aaron Brown [ mailto:aayore@gmail.com ]=20
*Sent:* Thursday, January 12, 2017 6:36 PM=20
*To:* Jed Walker=20
*Cc:* sfs=20
*Subject:* Re: [SFS] mounting linux filesystem from local drives=20



The local drives won't move around on you. They're not subjected to=20
the same dynamic mapping that's incurred when you use remote disks.=20
But if you're worried about it, you could mount by label. Just use=20
`xfs_admin -L my_data_disk /dev/sdb1` to label the partition and use=20
LABEL=3Dmy_data_disk in place of /dev/sdb1 your fstab.=20



-Aaron=20




*Jed Walker* < mailto:jedwa@comcast.net >=20



January 12, 2017 at 6:29 PM=20



I have a local disk (raid10) I mounted for storage in CentOS 7. From=20
reading I believe there is no reason to put LVM on top and I can just=20
partition and mount. So I figured I mount the filesystem directly on=20
the partition.=20



/etc/fstab, like:=20



/dev/sdb1 /mydata xfs defaults,noatime 0 0=20



This all worked fine and seems fine after reboot, but I got worried.=20
This is not something I=E2=80=99ve done before since my experience is with =
big=20
databases, thus I have only worked with mounting external LUNs from=20
storage devices. On those I always use multipath and udev to associate=20
them to the disks because the /dev/<dev> names can change on reboot.=20




Is this not true with local drives? i.e. will the local drives always=20
mount with the same name, thus my /etc/fstab above is valid?=20



Thank you for your help,=20



Jed=20


------=_Part_5877_469268119.1484322560547
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"font-family: times new roman, new york, times, se=
rif; font-size: 12pt; color: #000000"><div>Some thoughts:<br></div><div>- I=
 like UUID=3D... better than LABEL=3D... for specifying what to mount. It's=
 even less likely to change or collide. You can discover the current label,=
 UUID, and some other interesting things by running `blkid` against the dev=
ice.<br></div><div>- Editing fstab while the system is running is fine, iif=
 you reboot or at least run `mount -av` to verify that you did what you mea=
nt. Doing it optimistically is a bad habit to get into.<br></div><div>- Sta=
rting with LVM and the smallest reasonable logical volumes is a really good=
 idea for machines that may be in service a long time.</div><div>- Labeled =
filesystems should appear by label in /dev/disk/by-label/ and not in /dev/m=
apper/.<br></div><div><br></div><div>```<br></div><div><span style=3D"font-=
family: courier new,courier,monaco,monospace,sans-serif;">[dlwillson@intecr=
owd-vboxws ~]$ ls -l /dev/disk/by-label/</span><br><span style=3D"font-fami=
ly: courier new,courier,monaco,monospace,sans-serif;">total 0</span><br><sp=
an style=3D"font-family: courier new,courier,monaco,monospace,sans-serif;">=
lrwxrwxrwx. 1 root root 9 Jan 13 08:20 VBOXADDITIONS_5.1.10_112026 -&gt; ..=
/../sr0</span><br><span style=3D"font-family: courier new,courier,monaco,mo=
nospace,sans-serif;">[dlwillson@intecrowd-vboxws ~]$ ll /dev/mapper/</span>=
<br><span style=3D"font-family: courier new,courier,monaco,monospace,sans-s=
erif;">total 0</span><br><span style=3D"font-family: courier new,courier,mo=
naco,monospace,sans-serif;">lrwxrwxrwx. 1 root root&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp; 7 Jan 13 08:19 centos-root -&gt; ../dm-0</span><br><span style=
=3D"font-family: courier new,courier,monaco,monospace,sans-serif;">lrwxrwxr=
wx. 1 root root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7 Jan 13 08:19 centos-s=
wap -&gt; ../dm-1</span><br><span style=3D"font-family: courier new,courier=
,monaco,monospace,sans-serif;">crw-------. 1 root root 10, 236 Jan 13 08:19=
 control</span><br><span style=3D"font-family: courier new,courier,monaco,m=
onospace,sans-serif;">[dlwillson@intecrowd-vboxws ~]$ blkid /dev/dm-0</span=
><br><span style=3D"font-family: courier new,courier,monaco,monospace,sans-=
serif;">/dev/dm-0: UUID=3D"6e274ff6-a3a5-4d02-9ace-1f99c11158ed" TYPE=3D"xf=
s" </span><br><span style=3D"font-family: courier new,courier,monaco,monosp=
ace,sans-serif;">[dlwillson@intecrowd-vboxws ~]$</span> <br>```<br></div><d=
iv><br></div><div><span name=3D"x"></span>--<br>David L. Willson<br>Teacher=
, Engineer, Evangelist<br>RHCE+Satellite CCAH Linux+ LPIC-1 SUSE_CLP LFCS<b=
r>Mobile 720-333-LANS(5267)<br>http://sofree.us<br><div><br></div>This is a=
 good time for a r3VOLution.<span name=3D"x"></span><br></div><div><br></di=
v><hr id=3D"zwchr"><div style=3D"color:#000;font-weight:normal;font-style:n=
ormal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size=
:12pt;" data-mce-style=3D"color: #000; font-weight: normal; font-style: nor=
mal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-s=
ize: 12pt;"><b>From: </b>"Jed Walker" &lt;jedwa@comcast.net&gt;<br><b>To: <=
/b>"Aaron Brown" &lt;aayore@gmail.com&gt;<br><b>Cc: </b>"sfs" &lt;sfs@thege=
ek.nu&gt;<br><b>Sent: </b>Thursday, January 12, 2017 9:04:11 PM<br><b>Subje=
ct: </b>RE: [SFS] mounting linux filesystem from local drives<br><div><br><=
/div><style><!--

@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Tahoma;
=09panose-1:2 11 6 4 3 5 4 4 2 4;}

p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09margin-bottom:.0001pt;
=09font-size:12.0pt;
=09font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
=09{mso-style-priority:99;
=09color:blue;
=09text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
=09{mso-style-priority:99;
=09color:purple;
=09text-decoration:underline;}
span.EmailStyle17
=09{mso-style-type:personal-reply;
=09font-family:"Calibri","sans-serif";
=09color:#1F497D;}
.MsoChpDefault
=09{mso-style-type:export-only;
=09font-size:10.0pt;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
--></style><div class=3D"WordSection1"><p class=3D"MsoNormal"><span style=
=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;=
;color:#1F497D" data-mce-style=3D"font-size: 11.0pt; font-family: 'Calibri'=
,'sans-serif'; color: #1f497d;">Yes, editing fstab while the system is runn=
ing is fine, I=E2=80=99ve done that a ton. I was wondering about the xfs_ad=
min command. If I have the time I=E2=80=99ll that command and see what happ=
ens (and reply). I just can=E2=80=99t afford to waste time fixing it since =
I have to get it to the DC Monday.</span></p><p class=3D"MsoNormal"><span s=
tyle=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&q=
uot;;color:#1F497D" data-mce-style=3D"font-size: 11.0pt; font-family: 'Cali=
bri','sans-serif'; color: #1f497d;"><br></span></p><div><br></div><p class=
=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&qu=
ot;,&quot;sans-serif&quot;;color:#1F497D" data-mce-style=3D"font-size: 11.0=
pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">Yes, I like LVM f=
or adding more space but the drive bays are full so I figured it wouldn=E2=
=80=99t be happening and we=E2=80=99ll hopefully move off to a storage devi=
ce for more space later.</span></p><p class=3D"MsoNormal"><span style=3D"fo=
nt-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color=
:#1F497D" data-mce-style=3D"font-size: 11.0pt; font-family: 'Calibri','sans=
-serif'; color: #1f497d;">&nbsp;</span></p><p class=3D"MsoNormal"><span sty=
le=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quo=
t;;color:#1F497D" data-mce-style=3D"font-size: 11.0pt; font-family: 'Calibr=
i','sans-serif'; color: #1f497d;">I appreciate all the help, and thanks for=
 the article on LVM and performance.</span></p><p class=3D"MsoNormal"><span=
 style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif=
&quot;;color:#1F497D" data-mce-style=3D"font-size: 11.0pt; font-family: 'Ca=
libri','sans-serif'; color: #1f497d;">&nbsp;</span></p><div><div style=3D"b=
order:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in" data-m=
ce-style=3D"border: none; border-top: solid #B5C4DF 1.0pt; padding: 3.0pt 0=
in 0in 0in;"><p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font=
-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" data-mce-style=3D"font-s=
ize: 10.0pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span sty=
le=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot=
;" data-mce-style=3D"font-size: 10.0pt; font-family: 'Tahoma','sans-serif';=
"> Aaron Brown [mailto:aayore@gmail.com] <br><b>Sent:</b> Thursday, January=
 12, 2017 7:03 PM<br><b>To:</b> Jed Walker<br><b>Cc:</b> 'sfs'<br><b>Subjec=
t:</b> Re: [SFS] mounting linux filesystem from local drives</span></p></di=
v></div><p class=3D"MsoNormal">&nbsp;</p><p class=3D"MsoNormal">It's defini=
tely fine to edit the fstab while the drive is online.&nbsp; It *should* be=
 fine to provide a label with the drive online, but if you've got stuff you=
 can't lose I'd advise testing somewhere else or unmounting the drive first=
.&nbsp; I'm really not sure if FS labels show up under /dev/mapper/.&nbsp; =
I think the label applies to the base block device, so I don't think device=
 mapper will pick it up and put it in /dev/mapper/.&nbsp; Let me know what =
you find out.&nbsp; :)<br></p><div><br></div><p class=3D"MsoNormal">Also - =
There's really no downside to LVM.&nbsp; It doesn't impact storage performa=
ce (<a href=3D"http://unix.stackexchange.com/questions/7122/does-lvm-impact=
-performance" target=3D"_blank" data-mce-href=3D"http://unix.stackexchange.=
com/questions/7122/does-lvm-impact-performance">http://unix.stackexchange.c=
om/questions/7122/does-lvm-impact-performance</a>) and it gives you a bunch=
 of options that you might want in the future.&nbsp; If you ever start to r=
un out of space, you could add a second RAID volume and use LVM to concaten=
ate them together.&nbsp; If space isn't an issue, then you've got room for =
snapshots.&nbsp; <br></p><div><br></div><p class=3D"MsoNormal">Jed Walker w=
rote:<br></p><div><br></div><p class=3D"MsoNormal"><br>Thank you Aaron. It =
is being use now, so can I run that while it is <br>being used to give it a=
 label, and then change the fstab and remount <br>later? Also, when you say=
 a =E2=80=9Clabel=E2=80=9D does that mean it will show as <br>something lik=
e /dev/mapper/&lt;label&gt; ?<br></p><div><br></div><p class=3D"MsoNormal">=
*From:*Aaron Brown [<a href=3D"mailto:aayore@gmail.com" target=3D"_blank" d=
ata-mce-href=3D"mailto:aayore@gmail.com">mailto:aayore@gmail.com</a>]<br>*S=
ent:* Thursday, January 12, 2017 6:36 PM<br>*To:* Jed Walker<br>*Cc:* sfs<b=
r>*Subject:* Re: [SFS] mounting linux filesystem from local drives<br></p><=
div><br></div><p class=3D"MsoNormal">The local drives won't move around on =
you. They're not subjected to <br>the same dynamic mapping that's incurred =
when you use remote disks. <br>But if you're worried about it, you could mo=
unt by label. Just use <br>`xfs_admin -L my_data_disk /dev/sdb1` to label t=
he partition and use <br>LABEL=3Dmy_data_disk in place of /dev/sdb1 your fs=
tab.<br></p><div><br></div><p class=3D"MsoNormal">-Aaron<br></p><div><br></=
div><p class=3D"MsoNormal"><br>*Jed Walker* &lt;<a href=3D"mailto:jedwa@com=
cast.net" target=3D"_blank" data-mce-href=3D"mailto:jedwa@comcast.net">mail=
to:jedwa@comcast.net</a>&gt;<br></p><div><br></div><p class=3D"MsoNormal">J=
anuary 12, 2017 at 6:29 PM<br></p><div><br></div><p class=3D"MsoNormal">I h=
ave a local disk (raid10) I mounted for storage in CentOS 7. From <br>readi=
ng I believe there is no reason to put LVM on top and I can just <br>partit=
ion and mount. So I figured I mount the filesystem directly on <br>the part=
ition.<br></p><div><br></div><p class=3D"MsoNormal">/etc/fstab, like:<br></=
p><div><br></div><p class=3D"MsoNormal">/dev/sdb1 /mydata xfs defaults,noat=
ime 0 0<br></p><div><br></div><p class=3D"MsoNormal">This all worked fine a=
nd seems fine after reboot, but I got worried. <br>This is not something I=
=E2=80=99ve done before since my experience is with big <br>databases, thus=
 I have only worked with mounting external LUNs from <br>storage devices. O=
n those I always use multipath and udev to associate <br>them to the disks =
because the /dev/&lt;dev&gt; names can change on reboot.<br></p><div><br></=
div><p class=3D"MsoNormal"><br>Is this not true with local drives? i.e. wil=
l the local drives always <br>mount with the same name, thus my /etc/fstab =
above is valid?<br></p><div><br></div><p class=3D"MsoNormal">Thank you for =
your help,<br></p><div><br></div><p class=3D"MsoNormal">Jed</p></div></div>=
<div><br></div></div></body></html>
------=_Part_5877_469268119.1484322560547--