You are not logged in.
Pages: 1
Hi,
I need to remove the mount point for my /home directory to create format that partition and need some advice.
I have already copied my /home dir and I'm ready to remove the mount point and format it but I'm not sure how. I found this guide on Ubuntu Forums, does this apply to arch and is their anything else that I'd need to do?
Thanks in advance.
Last edited by guriinii (2011-08-03 23:38:30)
The exponential learning curve.
Offline
I often reboot so the entire partition table is re-read. You can do this with partprobe too I believe, the key being your system needs to acknowledge the new partition layout.
Offline
I'm not sure I understand. Do you have a separate partition for /home already and need to re-format it, or do you want to create a new partition to mount at /home?
The output of mount and fdisk -l, and maybe the contents of /etc/fstab might help clear things up.
In any case, 'removing the mount point' is very much the wrong phrase to describe what you're trying to do. The link you posted was about permanently removing user created mount points.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
I often reboot so the entire partition table is re-read. You can do this with partprobe too I believe, the key being your system needs to acknowledge the new partition layout.
I haven't partitioned anything yet I need to remove the mount point but am unsure how.
The exponential learning curve.
Offline
Alphaniner caught an obvious thing that I, in my errant ways, missed.
Changing or removing a mount point would be doing something like: rmdir /media/abcde; that's removing a mount point.
Changing or removing a partition and re-making it, is entirely different because then you have to remove the partition with partitioning tools, such as cfdisk or parted.
Which of these two options do you want to pursue? And yes please post your fstab and the output of
fdisk -l
Offline
Sorry for the lack of clarity. I want to remove the patition 'sda4' but my /home directory is it's mount point.
Output of fdisk -l
# fdisk -l
Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders, total 156250000 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: 0x41ab2316
Device Boot Start End Blocks Id System
/dev/sda1 * 63 208844 104391 83 Linux
/dev/sda2 208845 738989 265072+ 82 Linux swap / Solaris
/dev/sda3 738990 89264127 44262569 83 Linux
/dev/sda4 89264128 156249999 33492936 83 Linux
/etc/fstab:
# <file system> <dir> <type> <options> <dump> <pass>
devpts /dev/pts devpts defaults 0 0
shm /dev/shm tmpfs nodev,nosuid 0 0
UUID=2ef2ad73-d682-4d26-b246-741dbdff5deb / ext3 defaults 0 1
UUID=58f74476-ac7e-4937-81c0-349add9d2c72 /home ext3 defaults 0 1
UUID=d205e654-a653-4756-b1e9-7150e5e7b023 swap swap defaults 0 0
UUID=faddf419-a8c9-4a04-84b3-3b3383f9187d /boot ext2 defaults 0 1
I apologise my fstab shows the UUIDs and isn't very clear so I ran this as well:
# df -h /dev/sda4
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 32G 12G 19G 38% /home
Can I backup /home then run "rmdir /home" and begin formatting that partition?
The exponential learning curve.
Offline
Can I backup /home then run "rmdir /home" and begin formatting that partition?
You backup then umount /home, not rmdir /home. You should be logged in as root before doing this. Here's how I'd go about it:
First thing, make sure you preserved the ownership and permissions when you backed up. If you did that, then all you should need to do is log out anyone besides root and umount /home. Then you can do whatever you want to the unmounted partition. If you intend to remount it, do so with a simple mount /home. If you format it with a different file system, be sure to modify fstab with the correct type. If you aren't going to remount it, be sure to remove the line from fstab.
When you copy the data back, again be sure you preserve the original ownership and permissions.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Thank you for the heads up about the permissions! That could have been bad!!
I previously backed up /home by creating a new directory and using this as root:
# cp -rv /home/* /home2/
I could not access /home2/guriinii/ "Permission denied". How could I do this and retain ownership and permissions?
The exponential learning curve.
Offline
I'm pretty sure cp -a is all you need (you can add the v if you want verbosity). But I've only done so a few times in non-critical situations so I'm not 100%.
You could also use tar, it preserves ownership, etc by default:
tar -cf /path/to/file.tar /home
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Thank you alphaniner!! Done it!
The exponential learning curve.
Offline
Pages: 1