Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-13-2012, 06:50 PM
|
#1
|
Member
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 77
Rep: 
|
Can I make these commands shorter?
I need to make this commands shorter to pass through Grub's 256 byte limit.
sudo su -
rm -r /home/partimag
mkdir -p /home/partimag
mkdir -p /tmp/local_dev
ntfs-3g /dev/sdb2 /tmp/local_dev
mount --bind tmp/local_dev/Clones /home/partimag
Unfortunately /home/partimag has to be deleted and then created.
I am trying to accomplish mounting sdb2/Clones as /home/partimag (where sdb2 is NTFS).
Is there anyway to make these commands shorter?
|
|
|
07-13-2012, 07:02 PM
|
#2
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
So you want /home/partimag to be deleted on each boot - correct? Add your commands at the end of rc.local file. As for mounting ntfs partition, just add them to /etc/fstab.
|
|
|
07-13-2012, 07:18 PM
|
#3
|
Member
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612
Rep: 
|
These are all shell commands. What does it have to do with your bootloader?
Nonetheless, why delete /home/partimag and then re-create it. Keep the /home/partimag directory and delete everything else under it.
Code:
rm -r /home/partimag
mkdir -p /home/partimag
# Use one command instead:
rm -r /home/partimag/* # This deletes everything under /home/partimag, but keeps /home/partimag
Or, combine the two mkdir commands into one command:
Code:
mkdir -p /home/partimag /tmp/local_dev
|
|
1 members found this post helpful.
|
07-13-2012, 09:41 PM
|
#4
|
Member
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 77
Original Poster
Rep: 
|
Combining mkdir helps. Thank you.
What if I use /mnt instead of /tmp/local_dev? It didn't cause any problem with the booting.
I changed the codes to
sudo su -
rm -r /home/partimag
mkdir -p /home/partimag
ntfs-3g /dev/sdb2 /mnt
mount --bind /mnt/Clones /home/partimag
And it still worked. This way I didn't have to create /mnt and /mnt is much shorter than /tmp/local_dev.
Since I don't know have much knowledge, I was worried that mounting to /mnt could cause problems.
Thanks again.
|
|
|
07-14-2012, 01:47 AM
|
#5
|
Member
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612
Rep: 
|
According to the FHS:
Quote:
/mnt : Mount point for a temporarily mounted filesystem
Purpose
This directory is provided so that the system administrator may temporarily mount a filesystem as needed. The content of this directory is a local issue and should not affect the manner in which any program is run.
This directory must not be used by installation programs: a suitable temporary directory not in use by the system must be used instead.
|
So mounting directly to /mnt would work, but it is not standard practice to mount a filesystem directly to /mnt. The standard way is to use a mount point under /mnt.
|
|
1 members found this post helpful.
|
07-14-2012, 01:56 AM
|
#6
|
Member
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 77
Original Poster
Rep: 
|
Yes, I understand that.
On this case; I had to fit the codes into the Grub 256 byte limit. Therefore, mounting to an existing place seemed easier.
Originally, what was advised was to create and put it in /tmp/local_dev.
I am just learning the stuff, so it is like I am experimenting.
Now, I am wondering that if I would get the same result if I created /tmp/a and mounted it there.
I will try probably.
Thanks.
|
|
|
All times are GMT -5. The time now is 04:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|