You are not logged in.

#1 2012-06-02 21:17:54

Chrilleee
Member
Registered: 2011-04-27
Posts: 34

/etc/fstab has gotten partitions wrong, something I can fix now?

So, I just wondered why there's no more space left on my /home than on the /, since I told the installation to put /home on another partition.
I checked my /etc/fstab and found this:

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
tmpfs           /tmp    tmpfs   nodev,nosuid    0       0
# DEVICE DETAILS: /dev/sda3 UUID=dd278126-c494-466b-9fd8-a2d8f5479314 LABEL=root
# DEVICE DETAILS: /dev/sda4 UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 LABEL=home
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 / ext4 defaults,noatime,discard 0 1
UUID=dd278126-c494-466b-9fd8-a2d8f5479314 swap swap defaults,noatime,discard 0 0

Where the commented device details are the ones that are correct.
I tried to comment them out and add this line

UUID=dd278126-c494-466b-9fd8-a2d8f5479314 / ext4 defaults,noatime,discard 0 1

But then I got something about some bad block when I tried to boot. But stil had access to all files on , so it seems like everything that belongs to root, has been put at sda3 as it should?

Is there anyone who knows how I can fix this without re-installing the whole system?

Offline

#2 2012-06-02 21:33:37

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

Chrilleee wrote:
# DEVICE DETAILS: /dev/sda3 UUID=dd278126-c494-466b-9fd8-a2d8f5479314 LABEL=root
# DEVICE DETAILS: /dev/sda4 UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 LABEL=home
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 / ext4 defaults,noatime,discard 0 1
UUID=dd278126-c494-466b-9fd8-a2d8f5479314 swap swap defaults,noatime,discard 0 0

Try this

UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 /home ext4 defaults,noatime,discard 0 1
UUID=dd278126-c494-466b-9fd8-a2d8f5479314 / ext4 defaults,noatime,discard 0 0

(edit) -- mount root first:

UUID=dd278126-c494-466b-9fd8-a2d8f5479314 / ext4 defaults,noatime,discard 0 0
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 /home ext4 defaults,noatime,discard 0 1

(assuming your root is ext4)

your home is on /dev/sda4, with a UUID of 4aaba731-3838-4d3e-b4a9-833ec723add8
your root is on /dev/sda3, with a UUID of dd278126-c494-466b-9fd8-a2d8f5479314

if you still have problems, please post output of

sudo blkid

Last edited by 2ManyDogs (2012-06-02 22:01:20)

Offline

#3 2012-06-02 21:42:57

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

This is confusing. Those comments should not be there. They are absolutely fucking useless!

From a "live" Linux distribution post the output of:

# fdisk -l
# blkid

2ManyDogs, in the examples from the fstab wiki, "/" is always mounted first, and with priority "1".

Here's mine:

# <file system>                                 <dir>           <type>  <options>                            <dump>  <pass>

tmpfs                                           /tmp            tmpfs   nodev,nosuid,noexec                     0       0

UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff       /               ext4    defaults,noatime                        0       1
UUID=f838b24e-3a66-4d02-86f4-a2e73e454336       /media/Storage  ext4    defaults,noatime,nodev,nosuid,noexec    0       2
UUID=14d50a6c-e083-42f2-b9c4-bc8bae38d274       /media/Backup   ext4    defaults,noatime,nodev,nosuid,noexec    0       2

"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#4 2012-06-02 21:56:31

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

OK, mount / first (reverse my first post). I was just trying to show the link between the UUIDs and the devices -- the OP was trying to mount root twice.

UUID=dd278126-c494-466b-9fd8-a2d8f5479314 / ext4 defaults,noatime,discard 0 1
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 /home ext4 defaults,noatime,discard 0 1

here's my fstab, from a new clean Arch install

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
UUID=1ecb6a66-4b92-452f-af86-038a315b42f8 swap swap defaults 0 0
UUID=7cfd559b-15e8-450f-9c09-71fd0afaddf6 /boot ext2 defaults 0 1
UUID=8a8ee02e-0213-4d7c-850f-665d8da92500 / ext4 defaults 0 1
UUID=8ffa611f-a610-459e-8540-fe5563abff2d /home ext4 defaults 0 1

Last edited by 2ManyDogs (2012-06-02 21:59:48)

Offline

#5 2012-06-03 00:29:50

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,141

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

Only root should have "1" for <pass>. Anything else you want checked should be "2".


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-06-03 00:38:12

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

^ interesting. That's the way it was set up when I did the install (I didn't change anything)

Offline

#7 2012-06-03 08:11:23

Chrilleee
Member
Registered: 2011-04-27
Posts: 34

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

2ManyDogs wrote:
Chrilleee wrote:
# DEVICE DETAILS: /dev/sda3 UUID=dd278126-c494-466b-9fd8-a2d8f5479314 LABEL=root
# DEVICE DETAILS: /dev/sda4 UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 LABEL=home
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 / ext4 defaults,noatime,discard 0 1
UUID=dd278126-c494-466b-9fd8-a2d8f5479314 swap swap defaults,noatime,discard 0 0

Try this

UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 /home ext4 defaults,noatime,discard 0 1
UUID=dd278126-c494-466b-9fd8-a2d8f5479314 / ext4 defaults,noatime,discard 0 0

(edit) -- mount root first:

UUID=dd278126-c494-466b-9fd8-a2d8f5479314 / ext4 defaults,noatime,discard 0 0
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 /home ext4 defaults,noatime,discard 0 1

(assuming your root is ext4)

your home is on /dev/sda4, with a UUID of 4aaba731-3838-4d3e-b4a9-833ec723add8
your root is on /dev/sda3, with a UUID of dd278126-c494-466b-9fd8-a2d8f5479314

if you still have problems, please post output of

sudo blkid

Tried to boot like that, but it didn't work at all. Gives me the same output of bad blocks.

DSpider wrote:

This is confusing. Those comments should not be there. They are absolutely fucking useless!

From a "live" Linux distribution post the output of:

# fdisk -l
# blkid

2ManyDogs, in the examples from the fstab wiki, "/" is always mounted first, and with priority "1".

Here's mine:

# <file system>                                 <dir>           <type>  <options>                            <dump>  <pass>

tmpfs                                           /tmp            tmpfs   nodev,nosuid,noexec                     0       0

UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff       /               ext4    defaults,noatime                        0       1
UUID=f838b24e-3a66-4d02-86f4-a2e73e454336       /media/Storage  ext4    defaults,noatime,nodev,nosuid,noexec    0       2
UUID=14d50a6c-e083-42f2-b9c4-bc8bae38d274       /media/Backup   ext4    defaults,noatime,nodev,nosuid,noexec    0       2

I think the lines may be there becayse I used one of the Archboot to install, it was a bit different from the original install I'm used to. But I had to do it this way, else it didn't work at all.


Well, I've tried to totally comment out the line saying swap right now, mening that all my fstab contains is:

UUID=4aaba731-3838-4d3e-b4a9-833ec723add8 / ext4 defaults,noatime,discard 0 1

Which make me think that both home and root are on the same partition, caus' it works just like usual right now.
And the disk it's all on is the one on 25GB, which is the one intended to be for the /home. The /-partition I set to just 19GB or something.

fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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
Disk identifier: 0xcbca64ba

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   143362047    71577600    7  HPFS/NTFS/exFAT
/dev/sda3       143362048   182432127    19535040   83  Linux
/dev/sda4       182432128   234441647    26004760   83  Linux

blkid

/dev/sda1: LABEL="System Reserved" UUID="026AFDE86AFDD87D" TYPE="ntfs" 
/dev/sda2: UUID="5082056482054FC0" TYPE="ntfs" 
/dev/sda3: LABEL="root" UUID="dd278126-c494-466b-9fd8-a2d8f5479314" TYPE="swap" 
/dev/sda4: LABEL="home" UUID="4aaba731-3838-4d3e-b4a9-833ec723add8" TYPE="ext4" 

So, what I need to do is to get everything, except /home, over to sda3 and then having it as root.
Is that possible from the current position I'm in?

Offline

#8 2012-06-03 09:43:04

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: /etc/fstab has gotten partitions wrong, something I can fix now?

Yeah, fdisk just confirmed that you don't have a swap partition (which you don't even need if you have 2 GB+ RAM).

[...]
/dev/sda3: LABEL="root" UUID="dd278126-c494-466b-9fd8-a2d8f5479314" TYPE="swap"    <---- No. Didn't I say to run it from a "live" Linux distribution?
/dev/sda4: LABEL="home" UUID="4aaba731-3838-4d3e-b4a9-833ec723add8" TYPE="ext4"

Here's your new fstab:

# <file system>                                <dir>       <type>   <options>                     <dump>  <pass>
tmpfs                                          /tmp        tmpfs    nodev,nosuid,noexec              0       0
UUID=dd278126-c494-466b-9fd8-a2d8f5479314      /           ext4     defaults,noatime                 0       1
UUID=4aaba731-3838-4d3e-b4a9-833ec723add8      /home       ext4     defaults,noatime                 0       2

Enjoy.


But if you want to move your /home to the root partition, you can do that too, nobody's stopping you. Heck, I don't use a separate /home. I like to keep my dot files separate from my storage partition. You can copy the files with "rsync -av source destination" and then remove the "/home" entry from fstab.

Last edited by DSpider (2012-06-03 10:08:38)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB