[SOLVED] fstab, chown or chmod - A partition

Forum rules
We don't support installations in VirtualBox, VMWare, qemu or others. We ignore posts about WINE, PlayOnLinux, Steam and Skype. We don't support btrfs, lvm, UEFI, side-by-side installations with GPT or dualboot with anything newer than Windows XP.
Google your problem first. Check the Wiki. Read the existing threads. It's okay to "hijack" an existing thread, yes! If your problem is not yet covered, open a new thread. To get the quickest possible help, mention the exact release codename in your post (uname -a is a good idea, too). Due to the lack of crystal balls, attach the output of lspci -nnk if you encounter hardware problems.
hinto
Forums Hottie
Posts: 298
Joined: Thu Dec 06, 2012 4:28 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by hinto » Fri Aug 30, 2013 12:13 pm

Sector11 wrote:If I plug it in - it gets mounted - consider it "made use of" :)
^That's not UUID, that's /dev/sdb.
-Hinto
"A human being should be able to... butcher a hog..." -Robert Heinlein

bizcuit
Gangbanger
Posts: 330
Joined: Sat Feb 16, 2013 8:31 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by bizcuit » Fri Aug 30, 2013 4:37 pm

Yeppers Pidsley good point, missed what you'd said about UUID vs /dev and the installer changing the swaps UUID everytime. Have seen that happen often enough and agree it's annoying. At the time only had 3-4 gnu/nix installs. For someone like you, could have who knows how many @ any given time. Could see how it'd drive a person nutz having to go through and correct it.

Of course agree with the don't share a /home. Never tried it, researched it and saw enough warnings and folks advising against it. In the situation Sector's described, each install would have it's own /home partition. Would just be mounted and accessible from the others. Honestly have never tried that myself. Though why wouldn't a /home partition be like any other shared data partition ? All the dotfiles and config files involved would be kept separate ... not shared.


Hope you guys/gals are having a good one. Vllbbq! :)
Last edited by bizcuit on Fri Aug 30, 2013 4:42 pm, edited 1 time in total.

hinto
Forums Hottie
Posts: 298
Joined: Thu Dec 06, 2012 4:28 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by hinto » Fri Aug 30, 2013 4:41 pm

last I checked, you don't need swap in fstab. Linux automatically mounts it if it finds it.
-H
"A human being should be able to... butcher a hog..." -Robert Heinlein

bizcuit
Gangbanger
Posts: 330
Joined: Sat Feb 16, 2013 8:31 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by bizcuit » Fri Aug 30, 2013 4:47 pm

Hmmm interesting, had never heard of that Hinto. That'd be a good solution, so is the one Pidsley went with too. Ah so many ways to skin a penguin. ;)

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by Sector11 » Fri Aug 30, 2013 8:13 pm

^^ @ Hinto ... cool ... I would never have guessed:

Code: Select all

 30 Aug 13 | 16:10:48 ~
    $ par
Partition: ID: / size: 15G used: 4.6G (34%) fs: ext4 dev: /dev/sda1 
           label: N/A uuid: 4fb35957-ffa5-4011-8cae-a3ed9e293c3b
           ID: /media/5 size: 117G used: 34G (31%) fs: ext4 dev: /dev/sda5 
           label: N/A uuid: 4e253402-7c18-4346-85ce-4eaa74877cfb
           ID: /media/10 size: 17G used: 44M (1%) fs: ext4 dev: /dev/sda10 
           label: N/A uuid: 684440b6-4b6c-4082-863b-5bab46e6f21c
           ID: /home size: 15G used: 4.5G (33%) fs: ext4 dev: /dev/sda2 
           label: N/A uuid: fabad1fb-6591-4c27-9b50-2720d9589d64
           ID: /media/bake size: 16G used: 1.6G (11%) fs: ext4 dev: /dev/sda8 
           label: N/A uuid: f667e6ac-b263-4cb1-858e-a768fcb69def
 
 30 Aug 13 | 16:10:51 ~
    $ 
but it is in fstab...

Code: Select all

UUID=12fdb838-a76f-4f29-a0cf-b5cdc6d379ed	none	swap	sw	0	0
... but with a mount point of none.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

hinto
Forums Hottie
Posts: 298
Joined: Thu Dec 06, 2012 4:28 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by hinto » Fri Aug 30, 2013 8:33 pm

Try commenting out the fstab entry...
If it works, then yahoo... I'm not quite losing my mind.
BTW... LiveCDs mount swap partitions on a hard drive automatically if they exist.
-Hinto
"A human being should be able to... butcher a hog..." -Robert Heinlein

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by Sector11 » Fri Aug 30, 2013 9:11 pm

hinto wrote:Try commenting out the fstab entry...
If it works, then yahoo... I'm not quite losing my mind.
BTW... LiveCDs mount swap partitions on a hard drive automatically if they exist.
-Hinto
Why would I want to comment it out? It's strange that a swap with no mount point is there, I don't know why it is, but meybe like you said, if it's used by Live/CD/USB's it's good to have it there.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

hinto
Forums Hottie
Posts: 298
Joined: Thu Dec 06, 2012 4:28 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by hinto » Fri Aug 30, 2013 9:23 pm

LiveCD's don't read your /etc/fstab.
I'll comment it out on mine and do swapoff/swapon.
Back in a sec.
-H

Edit: Looks like LiveCD's are doing a bit of magic by querying for the swap partition UUID, then turning it on. swapon appears to want the /etc/fstab entry.

-Hinto
"A human being should be able to... butcher a hog..." -Robert Heinlein

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by Sector11 » Fri Aug 30, 2013 10:31 pm

OK, noob alert - you lost me with "and do swapoff/swapon"

You commented it out in your fstab... how do you know it turned it on when booting from a LiveCD?
Unless you can slow motion the stuff that flies by ... I have never been able to read that.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

bizcuit
Gangbanger
Posts: 330
Joined: Sat Feb 16, 2013 8:31 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by bizcuit » Fri Aug 30, 2013 11:11 pm

Example is using sudo again of course. Yeppers as root not needed.

Turn off swap:
"sudo swapoff -a"
Turn swap back on: "sudo swapon -a"

Still an interesting reminder and infobit Hinto, though appears you do need an fstab entry for the swap partition. Remember people mentioning that creating a swap partition would allow people to successfully install a gnu/nix OS on a pc that'd be too low RAM to do it otherwise. Like ya said the installer is supposed to detect and use any swap partition available.

Never actually had to try it but plenty of folks said it's so. How goes the mounting of shared partitions Sector ? Glad Pidsley brought up the installer reformatting swap and assigning a new UUID every time you do an install. It's easy to fix Sector, After installing a new nix OS. Bootup any installs that you've noticed the swap parition is no longer available in. Use the "sudo blkid" to get the new UUID for the swap and then copy/paste the sucker into ea swap borked installs fstab file. Replacing the old swap UUID with the new/correct one and whamo ! You'll have your swap parition working again in that OS.

You only have 2-3 gnu/nix installs but it's still a pain in de arse putting the new swap UUID in ea installs fstab. Never tried it but wonder if someone can mix UUID's and /dev/sdaX in fstab ? If you can, could make sense to use /dev/sdaX for the swap partition ( like Pidsley is doing.) instead of it's dang UUID.

ie: If my swap were on sda5 fstab entry for it would be.

# swap was on /dev/sda5 during installation
/dev/sda5 none swap sw 0 0

Anyone know if it's possible to mix UUID's and /dev/sdaX entries in fstab ? Ah hell I'll try it out myself ... report back a bit later fellas.

Findings: Yep looks like swap is working fine here. At least it's showing up and seems normal when did "free -m", after changing the swap fstab entry to /dev/sdaX. Ha thanks to Pidsley .. Seems like a much better solution for the nix multibooter than having to correct the stinking UUID in all OS's every time the swap partition gets formatted.

hinto
Forums Hottie
Posts: 298
Joined: Thu Dec 06, 2012 4:28 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by hinto » Sat Aug 31, 2013 1:46 am

UUID only changes if you create a new partition. Reformatting won't change it (or at least it shouldn't)
Check the results next time you install. (I was wrong about not needing the fstab entry. I might be wrong about this, too ;) )
-Hinto
"A human being should be able to... butcher a hog..." -Robert Heinlein

bizcuit
Gangbanger
Posts: 330
Joined: Sat Feb 16, 2013 8:31 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by bizcuit » Sat Aug 31, 2013 4:54 am

No worries Hinto ... we've actually had this convo before in Crunchville Yeppers fellow nixer, have seen the Debian installer format swap and change the the partitions UUID several times. Hopefully it's something that's been corrected between then and now ? Hope you all are having a good night going on.


Vllbbq! :)

User avatar
johnraff
Sperminator
Posts: 199
Joined: Wed Oct 17, 2012 6:38 pm
Location: Japan
Contact:

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by johnraff » Sat Aug 31, 2013 6:38 am

There's another alternative to /dev/* or UUID, labels.
Both /dev names and UUID's can change, but if you give a partition, or usb stick, a label it will stay till you format it. Then you can mount, say, a squeeze partition with the label 'squeeze' with

Code: Select all

sudo mount -L squeeze /path/to/mount
Thunar will display the drive by its label and automounting also usually uses the label name for the mountpoint, which might be handy.
Add labels with gparted or some cli command I forget...
All code is one.

bizcuit
Gangbanger
Posts: 330
Joined: Sat Feb 16, 2013 8:31 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by bizcuit » Sat Aug 31, 2013 9:08 am

So many friggin ways to go with gnu/nix can make a persons head explode ! Thanks John for bringing another option to the table. Plan on leaving fstab as is for now. UUID's for everything except swap and /dev/sdaX for the swap partition. See if anything borks ... :D

My luck there'll be some sweeping change and the OS will suffer borkage ... sighs. Oh well, am well armed with Xaos52's chroot how to if anything does go wrong. Plus a decent trickbag of other good unborkage techniques.

Public service announcement !!! Today is international nix borkage awareness day fellows. Borkage is always lurking ... never forget that ! Of course ^ that is complete bs but borkage can happen @ anytime! D: Toooooo much coffee dang it !

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by Sector11 » Mon Sep 02, 2013 5:25 pm

@ johnraff - this lable thing has peaked my interest. Must look into that...

Code: Select all

$ e2label
maybe ... gotta run?
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

User avatar
xaos52
The Good Doctor
Posts: 190
Joined: Thu Aug 15, 2013 11:59 am
Location: Eernegem, Belgium

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by xaos52 » Mon Sep 02, 2013 5:35 pm

Code: Select all

sudo e2label /dev/sdxy label
replace x by the device character, y by partition number and label by the desired label (max 16 chars, better avoid spaces and special characters)
Connected. Take this REPL, brother, and may it serve you well.

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by Sector11 » Mon Sep 02, 2013 6:36 pm

Perfect thank you johnraff and xaos52

<--- me typo prone 3.5 finger look at the keyboard hunt and peck typist. functions and aliases are my friends.

... A long time ago a friend gave me some sample functions ... soooooooo
I made a bash function:

Code: Select all

## Change or add labels on a Partition #######################################
lpar() {
      sudo e2label /dev/sda$1 $2
}
Since I only have one HDD I used /dev/sda$1, with more /dev/$1 $2 would work I would imagine.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

User avatar
johnraff
Sperminator
Posts: 199
Joined: Wed Oct 17, 2012 6:38 pm
Location: Japan
Contact:

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by johnraff » Tue Sep 03, 2013 3:49 am

^Sector, be very careful with using functions for action on drives like this. One little slip, an unmeant space or an unset variable can do serious damage.
eg /dev/sda$1 will revert to /dev/sda if $1 is unset...
All code is one.

bizcuit
Gangbanger
Posts: 330
Joined: Sat Feb 16, 2013 8:31 pm

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by bizcuit » Wed Sep 04, 2013 1:45 am

Just checking in @ the grill. :)

And an update, swap still working fine here using /dev/sdaX for it and UUID's for the other partitions in fstab. At least it's showing up, is the right size etc. So concluding from this brief experiment that mixing UUID's and /dev/sdaX for swap isn't a problem.

Never tried using labels to identify partitions. If anyone has the time or desire. What's the advantages-benefits of assigning labels over UUID or /dev/sdXX ? Regardless hope all the kewl nixers here are having a peach of a dy/nt. Cya's later ...


Vll! :)

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: [SOLVED] fstab, chown or chmod - A partition

Unread post by Sector11 » Wed Sep 04, 2013 2:40 am

johnraff wrote:^Sector, be very careful with using functions for action on drives like this. One little slip, an unmeant space or an unset variable can do serious damage.
eg /dev/sda$1 will revert to /dev/sda if $1 is unset...
OH HELL!!!! Kill that function.

Thank You John ....
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

Post Reply